Welcome Guest [Log In] [Register]
Welcome to EV Forums. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Javascript Help
Topic Started: Sep 17 2007, 01:16 PM (364 Views)
Cyndaquil201
Member Avatar
Controller of the Writers' Sphere of Nothing
Okay. I've been trying to make a password thing with Javascript where you can enter a password and it redirects you somewhere. Just a normal password thing. I made it using alerts, but I don't like alerts that much, so I decided to use a form.

It worked fine, except, instead of redirecting me, the url changed from this:

testing.html

to this:

testing.html?password=blahblah

and I have no idea what to do.

This is my code:

Code:
 

<html>
<head>

<script type="text/javascript">
<!--
function testing()
{
var password;
var pass1 = "rirrel";
var pass2 = "ineedtotestthis";

if (password=pass1) {
window.location = "rirrel.html";
}
else if (password=pass2) {
window.location = "password.html";
}
else {
alert("Incorrect.")
}
}
// -->
</script>
</head>
<body>
<form onsubmit="testing()">
<p><b>Password:</b> <input type="text" name="password">
<br>
<input type="submit" value="Submit">
</p>
</form>
</body>
</html>
CYNDA used MAX REVIVE!
Posted ImagePosted Image
Sprite credits: Electro (cradily) and Smeargle (awesome thing).
Cynda's blog-thing
Cynda's List of Interesting Topics By Various People
Golden Light : Ileen and the Fire Mountain and other stories : Swordplay : What Pokemon would live in your area? : Dreams : Cynda's Jar of Sprites
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Web Help · Next Topic »
Add Reply


Skin by Kronakitty. Brushes from Celestial Star and Magitek Designs.