EvvO2004
10-17-2003, 07:36 PM
I need a few check boxes to return a value if they are not checked.
e.g...
if the tick the 'box1' the form returns the value ...
box1=YES
if you don't tick 'box1' the form returns the value ...
box1=NO
Here's the HTML page so far ...
<script language="JavaScript" type="text/JavaScript">
function DoCheck() {
if(document.form.box1.checked == false)
(document.form.box1.value = "NO");
if(document.form.box2.checked == false)
(document.form.box2.value = "NO");
}
</script>
<title>Form Test</title>
</head>
<form action="mailer.asp" method="post" name="form">
<input name="_recipients" type="hidden" value="animations@ntlworld.com">
<input name="_replyToField" type="hidden" value="Email">
<input name="_subject" type="hidden" value="Form Test">
<input name="_redirect" type="hidden" value="test.htm">
<input type="checkbox" name="box1" value="YES">
<input type="checkbox" name="box2" value="YES">
<input type="submit" onClick="DoCheck()">
</form>
e.g...
if the tick the 'box1' the form returns the value ...
box1=YES
if you don't tick 'box1' the form returns the value ...
box1=NO
Here's the HTML page so far ...
<script language="JavaScript" type="text/JavaScript">
function DoCheck() {
if(document.form.box1.checked == false)
(document.form.box1.value = "NO");
if(document.form.box2.checked == false)
(document.form.box2.value = "NO");
}
</script>
<title>Form Test</title>
</head>
<form action="mailer.asp" method="post" name="form">
<input name="_recipients" type="hidden" value="animations@ntlworld.com">
<input name="_replyToField" type="hidden" value="Email">
<input name="_subject" type="hidden" value="Form Test">
<input name="_redirect" type="hidden" value="test.htm">
<input type="checkbox" name="box1" value="YES">
<input type="checkbox" name="box2" value="YES">
<input type="submit" onClick="DoCheck()">
</form>