<input type=\"checkbox\" name=\"ed[{$row['id']}]\" value=\"Y\">
This part of the system has been working perfectly for weeks.
Now I've been asked to add client side validation to make sure at least one of the records (checkboxes) has been checked before sending the data to the results page. (The results page already has working validation code in it.)
I've have the following javascript code that should work for my purposes if I can figure out how to dynamically build the javascript code.
<SCRIPT> function validate() { if (!(mainform.ed[0].checked || mainform.ed[1].checked)) { alert('Please check at least one record before submitting this form.'); event.returnValue=false; } } </SCRIPT>
This is the line I need to build dynamically:
if (!(mainform.ed[0].checked || mainform.ed[1].checked)) {
Any help, pointers, suggestions, etc. will be greatly appreciated.
Thanks.
Albert Padley
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php