Raised This Month: $ Target: $400
 0% 

JavaScript help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 12-17-2010 , 10:46   JavaScript help
Reply With Quote #1

In need of help with JavaScript.
I'm trying to make a checkbox with a submit button which you have to check to redirect/continue to the 'newpage.php' file.

You don't get redirected to 'newpage.php' when you check the checkbox and submit. It just refresh the current page you are on.
PHP Code:
<html>
<
head>
<
script language=javascript>
function 
validate(chk){
  if (
chk.checked == 1)
    
window.location='newpage.php';
  else
    
alert('You have not agreed!')
}
</script>
</head>

<body>
    <form>
        <input type='checkbox' name='chk1' /> Agree<br />
        <input type='image' src='images/continue.jpg' align='right' onclick='return validate(chk1);' />
    </form>
</body>
</html> 
Appreciate all help.

Last edited by Rirre; 12-17-2010 at 10:57.
Rirre is offline
 


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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode