Checking multiple form on one page
I have a page with several forms. Each one with a radio group with values 'yes' and 'no'.
Only one form on the page can and must contain the value 'yes'.
All forms have the same id and all radios have the same name.
Is this at all possible?
This is not possible. IDs are UNIQUE.
If you make multiple forms, give them a unique ID each.
Control elements contained in a form can have a name which you already gave to another control element in another form since when you submit the form, only the values of the control elements inside that one form are sent to the server.
If you want to submit all forms at once, you will have to use JS. You could serialize the forms into JSON and then send the JSON to your back-end. Multiple control elements with the same name will still work.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)