PDA

View Full Version : HTML question...


qristopher
02-08-2006, 08:15 PM
Hey all. I have a question concerning some HTML form work. I KNOW, this is definitely not a forum for this topic, but I figure most of the people on here have a lot more experience than I, so hopefully someone can give me a hand...

I have a terms & conditions popup page with a checkbox and a button on the bottom. When you check the box and click the button, the window closes and takes you to a specific URL in a new window. Easy enough, except that I erased what I had done, and now I can't get it to do the same thing again. I'm totally at the end of my rope, and obviously fried if I can't see what mistakes I've made. Please help!!!!

<head>
<script language="JavaScript">
function checkAndSubmit()
{
if(document.form.Agree.checked)
{
document.form.submit();
window.close();
}
else
{
alert("You must agree to the Terms and Conditions to continue");
}
}
</script>
</head>

///AND///

<form action="http://www.acteva.com/booking.cfm?bevaid=104296" method="post" enctype="multipart/form-data" name="Agree" target="_blank">
<label>
<input name="Agree" type="checkbox" id="agree" value="checkbox">
</label>
<span class="body">
Check box if you agree to the Terms &amp; Conditions
</span>
<label>
<input name="submit" type="button" value="submit" onClick="checkAndSubmit">
</label>
</form>

CamX
02-22-2006, 01:49 AM
Fix it.:)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="javascript" type="text/javascript">
function checkAndSubmit()
{
if(document.agree_form.agree.checked)
{
window.close();
return true;
}
else
{
alert("You must agree to the Terms and Conditions to continue");
return false;
}
}
</script>
</head>
<body>

<form action="http://www.acteva.com/booking.cfm?bevaid=104296" method="post" onsubmit="return checkAndSubmit(this)" name="agree_form" target="_blank">
<label>
<input name="agree" type="checkbox" id="agree" value="checkbox" />
</label>
<span class="body">
Check box if you agree to the Terms &amp; Conditions
</span>
<label>
<input name="submit" type="submit" value="submit" />
</label>
</form>
</body>
</html>