Closed boyankostov closed 6 years ago
Hi @boyankostov and thank you for your report.
From Web Standards perspective you should be able to put at least one required on any input in a group to make a whole group required, however, it is recommended to put required attribute on every input in a group.
Currently, yes, Bunny Validation is not taking this case of radio button group into account and thinks of every input as a separate input.
I will try to release an update this weekend.
Anyway from a UX perspective, it is not recommended to have a required radio button group without option selected by default, because user can not get back to initial state by unchecking the checked radio button.
I do prefer simple one checkbox for boolean inputs. Do you agree with terms? Then check a box, Do you want to receive email notifications? Then check the box and so on.
Thanks for the swift reply. I totally agree with you that it's a better UX approach to have an already selected option, but in this case I want to eliminate any bias and keep only one possible choice. Placing a single checkbox would also introduce bias in the results, cause this is not a turn on/off switch, but a question.
Thanks a bunch for taking this into account, I'll keep track of the thread.
Fixed in https://github.com/Mevrael/bunny/commit/90bea09545288e0f050b5c2a5f72c0ed7252b98e
Please let me know if issue is solved or you have any additional questions and if anything is fine, feel free to close this issue.
P.S. you may also join our Gitter chat https://gitter.im/bunny-js/Lobby
Thanks a bunch, it's working now!
Hey, how do I setup a yes/no radio group? I tried placing required on both fields and separately on each one, to no avail. It only accepts Yes as a possible answer.
`
`