OK, lets say I have a checkbox for, say, agree to terms. BUT, I have a form that has required information that has to be validated against some conditions.
Now, my problems are [LIST]how to validate that the box is actually checked and display the appropriate message
[/LIST][LIST]how to preserve the checked state - if checked and other errors cause the form to refresh - so the user can fix the errors
[/LIST]
So, for the sake of argument, my code is something like:
How can I call my function VerifyForm(&$values, &$errors) where $values[‘waiverAgree’] needs to be processed. Or… am I trying something really different or far out??
As i understand you want to take some action on status of checkbox. I mean its selected or not selected . And if selected than what value was there. right?
If so than what you can do is, create one hidden textbox.
When someone checked checkbox than grab the value of checkbox and set it as a value of hidden textbox by javascript.
Now whenever you want to check want happened, you can retrieve value of textbox. If its empty than nothing was checked. If there is some value than on base of value you can decide what further action you want to perform.