irst post here, i'll try to be simple: I need to create a form where participants of a medical convention register to classes, each class lasts 3 hours, so a person who wants to attend to class starting at 10 am cannot register to 11 am, 12pm and 1pm classes, but he can register to 2pm and so on.
There are 3 different classes per hour.
i thought doing this using javascript, but i'm absolutely lost.
Can you please give me a hint on how to do this?
Thanks!!
this is the part of the form that has the checkboxes.
Use radio buttons instead, in two groups - before/after lunch. Disable any radios which are invalid selections. (If I understand you anyone who elects for a 1200 class cannot then attend any other session).
Suggest you include a one-hour lunch pause!
If for some reason you realy want checkboxes then it is possible to make them emulate radio butoons (i.e. only one per group may be selected).
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Do you want to achive this using only javascript i.e. client side only or will be comfortable if done at server side
Well, the OP posted in the Javascript forum. But yes, all Javascript validation should be repeated server-side. JavaScript form validation only provides convenience for users, not security. This means that JavaScript should be used as an "enhancement", not as a requirement. So your form should not be dependent on JavaScript alone to perform your validation. Instead, whatever server-side language you use to process the form (PERL, ASP, PHP, etc.) should also perform the same validation. Otherwise, people will be able to bypass your validation (and even possibly inject malicious code) simply by disabling Javascript.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.