It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Redirect using if function

Redirect using if function

Postby johnfrankfu on Mon Nov 21, 2011 2:04 pm

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
johnfrankfu
 
Posts: 1
Joined: Mon Nov 21, 2011 12:03 pm

Who is online

Users browsing this forum: No registered users and 10 guests