Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
10-08-2003, 02:15 AM #1
- Join Date
- Jul 2002
- New Zealand
- Thanked 0 Times in 0 Posts
Radio Buttons Accross Multiple Forms
I have an admin page where I can see every product in my store sorted into groups (their categories). Each product has it's own form with checkboxes for changing attributes and a submit button for setting them.
My problem is that there is one attribute that only one product per category can have. But since each product has it's own form, even if each has a radio button with the same name, multiple boxes may be selected.
This is a rough XML style explanation of the page structure:
<category1> <form> <product1> <radio1> </product1> </form> <form> <product2> <radio1> </product2> </form> <form> <product3> <radio1> </product3> </form> </category1> <category2> <form> <product4> <radio2> </product4> </form> <form> <product5> <radio2> </product5> </form> </category2>
Thanks a lot, I appreciate your help.
Last edited by Candrias77; 10-08-2003 at 05:31 AM.eTheory - the theory of revolution
10-08-2003, 08:38 AM #2
- Join Date
- Apr 2003
- Bucharest, ROMANIA
- Thanked 379 Times in 375 Posts
If the radio buttons have the same name, the check of one of them will automatically disable the check on other, this might be a simple HTML solution of your problem. If you have to submit the result, give different values (even the same name), and that will do the job.
where i and j are positive integer numbers from 0, and shows the forms/elements order in page from top to bottom.
To check/uncheck a radio button you have to use true and false boleean operators and to evaluate the state of the check situation