I have a multi-fieldset HTML form that has a
Motor fieldset and a
Frame fieldset as part of it. When I need a motor, I populate that part of the form. When I expressly do not need it, I am however required to enter data into
Frame fielset. I am not sure how to indicate so via UI so both user and server (one that is receiving data) can understand it. What I mean by this is that say I clearly convey it to the user that only one of the two fieldsets is to be filled out. They fill out only one of them. How do I indicate it to the server that will receive form data that user indented to fill out that specific fieldset?
Easiest thing is to add a checkbox inside the Motor fieldset stating something like
Ignore this motor [x]
The only thing that is stopping me from doing so is that I am using an API library to create my form, and each fielset, so implementing the above will make the "Ignore" checkbox be part of my Motor Entity object, which is not essential to the Entity. But if there is no better solution, maybe I can overlook this ...
Second best is to implement a separate fieldset where I say
motor present? [x]
unchecking which will via JS disable the Motor fieldset. This might be a better solution at the expense of adding another "Control" fieldset. My problem with this is ... an extra fieldset, which is not immediately apparent that it is adjacent to the Motor. I mean users will know it is upon closer inspection so I can too overlook this and implement it if no better solution available.
TL;DR: How can I indicate on an HTML form that a "Motor" fieldset is optional?
In full case scenario user must enter one of either Motor of Frame (but not both, and not neither). Each fieldset is generated by a library, where there is a domain entity object behind each. So if any new element has to be added, it will have to become part of that entity. That's why I am considering going outside of the fieldsets as well.