hi,
i need some help.....
currently, i have a form consisting of some chekboxes....
<td>a <input type="checkbox" name="services" value="a" /></td>
<td>b <input type="checkbox" name="services" value="b" /></td>
<td>c <input type="checkbox" name="services" value="c" /></td>
<td>d <input type="checkbox" name="services" value="d" /></td>
<tdeG <input type="checkbox" name="services" value=G" /></td>
<td>f <input type="checkbox" name="services" value="f" /></td>
i'm doing a validation using javascript...and after the validation i'm suppose to do a $_POST[services]
but for php to display the value the checked checkboxes, the name of the checkboxes must be declared as name="services[]"....with the array box....but if i put the array box, i will not be able to do validation using javascript......
can anybody help??
thx,
zinc
validating and processing..
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
big hint:
Code: Select all
document.forms['yourFormName'].elements['services[]']Code: Select all
<td>a <input type="checkbox" name="services[]" value="a" id="services" /></td>Code: Select all
services = document.getElementById('services');
//do all your fun js stuff here