Current location: Hot Scripts Forums » General Web Coding » JavaScript » Redirect using IF function


Redirect using IF function

Reply
  #1 (permalink)  
Old 11-22-11, 07:46 AM
johnfrankfu johnfrankfu is offline
New Member
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy 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!="xxxx"){
alert("Invalid Password");
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>Password:</label><span><input type="password" name="pwd1"></span>
<span><input type="submit" value="Submit"></span>
</fieldset>
</form>
</html>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can someone explain this to me? phphelpme PHP 3 09-11-11 01:25 PM
Trying to make my affiliate links open in a new window browser??? bigendz13 PHP 3 10-26-10 08:35 AM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 02:08 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.