| You are here: DEVPPL ‹ Forum ‹ Programming ‹ HTML Forum |
NOTIFICATIONS
|
|
|||||||||||||||
Login |
Redirect using if function
1 post
• Page 1 of 1
0
Redirect using if function
Please help. I'm trying to use if function to redirect, but it is not working.
<html>
<head>
<p><fontface="Arial"size"3">Please enter the username.</p></head>
<scripttype="text/javascript"
function checkForm(form)
{
if(form.pdw1.value!="VOHASHAMK"){
alert("Username does not exist!");
form.pwd1.focus();
return false;
}
if(form.pdw1.value=="xxxxx"){
document.location = "http://xxxx.html"
}}
</script>
<form method="POST" action="/javascript/validate/1/" onSubmit="return(checkForm(this)&&false);">
<fieldset>
<label>Username:</label><span><input type="password" name="pwd1"></span>
<span><input type="submit" value="Login"></span>
</fieldset>
</form>
</html>
john.frankfu@gmail.com
<html>
<head>
<p><fontface="Arial"size"3">Please enter the username.</p></head>
<scripttype="text/javascript"
function checkForm(form)
{
if(form.pdw1.value!="VOHASHAMK"){
alert("Username does not exist!");
form.pwd1.focus();
return false;
}
if(form.pdw1.value=="xxxxx"){
document.location = "http://xxxx.html"
}}
</script>
<form method="POST" action="/javascript/validate/1/" onSubmit="return(checkForm(this)&&false);">
<fieldset>
<label>Username:</label><span><input type="password" name="pwd1"></span>
<span><input type="submit" value="Login"></span>
</fieldset>
</form>
</html>
john.frankfu@gmail.com
- Johnfrankfu
- Reputation: 0
- Posts: 1
- Joined: Mon Nov 21, 2011 1:03 pm
- Highscores: 0
- Arcade winning challenges: 0
|
|