Jump to content

checkbox validation


Recommended Posts

hello,

i have this piece of code:

<table border=0 cellspacing='0' cellpadding='0' class='paragraph' style=margin-top:20pt; width='1146'>

<tr valign='top'>

<td width='201' height='26' align='left' $fieldLabelStyleString><div align='left'><font color='black'>Certyfying Organization</font>{$errorArray["cprorgname"]}</div>

<td height='26' align=left width='945'><input type='text' name='otherInfoArray[cprorgname]' value='{$otherInfoArray['cprorgname']}'>

Type of CPR <font face='Arial, Helvetica, sans-serif' size='1' color='red'><em>*</em></font>

Adult CPR <input type='checkbox' name='otherInfoArray[cpradult]' value='{$otherInfoArray['cpradult']}'>

Child CPR <input type='checkbox' name='otherInfoArray[cprchild]' value='{$otherInfoArray['cprchild']}'>

Infant CPR <input type='checkbox' name='otherInfoArray[cprinfant]' value='{$otherInfoArray['cprinfant']}'>

</td>

</tr>

<tr valign='top'>

<td width='26' height='26' align='left' $fieldLabelStyleString><div align='left'><font color='black'>Issue Date</font>{$errorArray["cprissuedate"]}</div>

<td height='26' align=left width='26'><input type='text' name='otherInfoArray[cprissuedate]' value='{$otherInfoArray['cprissuedate']}'>

Expiration Date {$errorArray["cprexpdate"]}<input type='text' name='otherInfoArray[cprexpdate]' value='{$otherInfoArray['cprexpdate']}'> <br>

I attest that I have renewed my CPR certification and will submit documentation to that effect upon request.<font face='Arial, Helvetica, sans-serif' size='1' color='red'><em>*</em></font>

Yes <input type='checkbox' name='otherInfoArray[cprattestyes]' value='{$otherInfoArray['cprattestyes']}'>

No <input type='checkbox' name='otherInfoArray[cprattestno]' value='{$otherInfoArray['cprattestno']}'>

</td>

</tr>

</table>

<DIV style='font-size:110%;text-align:left;margin-top:15pt;'>

<font face='Arial Black, Helvetica, sans-serif' size='5' color='black'>SUGGESTIONS/COMMENTS </font>

</div>

and I want for people to check the cprattestyes box and go next.

if they do not check that box they will not go next

thanks

Link to comment
Share on other sites


there are a few ones, the easiest one is to use javascript.

then for whatever thing the click to go to the next page, have do onclick="check()"

your check() function will need to get the value of that checkbox and make the necessary checks.

then if the value="checked" ? i think it's checked, it might be "on", then go ahead and submit the forum, otherwise you can do something like make an alert with an error in it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...