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.