I found a script that will do this but I’m wondering if there is a way to modify it so that it makes the user confirm once more that they accept. Maybe have another alert that asks them:
Please choose OK to accept the terms or Cancel to exit.
Can this be added?
<SCRIPT language=JavaScript>
<!--
//Accept terms & conditions script (by InsightEye www.insighteye.com)
//Visit JavaScript Kit (http://javascriptkit.com) for this script & more.
function checkCheckBox(f){
if (f.agree.checked == false )
{
alert('Please check the box to continue.');
return false;
}else
return true;
}
//-->
</SCRIPT>
<form action="/yourscript.cgi-or-your-page.html" method="GET" onsubmit="return checkCheckBox(this)">
<!--Enter your form contents here-->
<b>By submitting, I agree that all info entered was done accurately & truthfully.</b><br>
I accept: <input type="checkbox" value="0" name="agree">
<input type="submit" value="Submit form">
<input type="button" value="Exit" onclick="document.location.href='/index.html';">
</form>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>untitled</title>
<script type="text/javascript">
function affirmData(oForm)
{
var oCheckbox = oForm.elements.agree;
if (oCheckbox.checked)
{
var OK = confirm('Please confirm: all information entered is accurate.\
\
Thank you.');
if (!OK)
return (oCheckbox.checked = false);
}
else
{
alert('Please check the "agreement" box to continue.');
oForm.elements.agree.focus();
return false;
}
}
</script>
</head>
<body>
<form action="javascript:alert('ok')" method="get" onsubmit="return affirmData(this)">
<!--Enter your form contents here-->
<b>By submitting, I affirm that all information entered is accurate & truthful.</b>
<br /><br />
You betcha. Agreed. <input type="checkbox" name="agree" value="1" />
<br /><br />
<input type="submit" value="Submit" />
<input type="button" value="Exit" onclick="self.location='/index.html'" />
</form>
</body>
</html>