If they are mutually exclusive, then give them all the same name. Otherwise, you'll just have to look at the "checked" property of each checkbox.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
I mean, if the user must pick one, but only one, of the checkboxes, then you should give them all the same name.
If you must give them a separate name, then you will have to inspect the ".checked" property of each checkbox in your validation function.
Do you know how to look at the ".checked" property of a checkbox?
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
You need to use server side code. Whatever processes the form should check for this.
Using Javascript can save the user some time, so that's good, too, but the code on the server that processes the form shouldn't assume that it has valid input.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Yes, data should be validated client-side, server-side, and also database-side.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Please post separate questions in a separate thread. Also, please don't use "chat shorthand" in forum messages. Rather, fully type out all words, and use proper spelling and punctuation. When seeking clarity, be clear!
Tell me exactly what it is about the checkbox situation that you want to "validate". First, are the checkboxes mutually exclusive? That is, are they part of a group of choices, and the user must pick one and only one of them?
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37