bootstrap-validator icon indicating copy to clipboard operation
bootstrap-validator copied to clipboard

Validation of required radio button group with disabled buttons

Open JanCusters opened this issue 8 years ago • 4 comments

Hi, I have a required radio button group of which I dynamically disable (and uncheck if applicable) certain buttons with jQuery. However when I trigger form validation without a radio selected and with disabled radio(s) present, the radio button group validates as correct instead of false. I can't use the trick with the readonly attribute and custom data-required validator since readonly doesn't work with radio buttons. Any tips on how I can achieve the desired behaviour?

JanCusters avatar Feb 09 '17 10:02 JanCusters

Are you using the $().validator('update') method after disabling or enabling a radio button?

1000hz avatar Feb 09 '17 16:02 1000hz

I'm having the same issue

rtone1 avatar Jun 09 '17 19:06 rtone1

the radio btns work fine as long as I don't hit the submit btn and the form has errors. if the form has errors and the radio btn was not checked before the submit event, validation won't get trigger on the radio btns. any clue?

rtone1 avatar Jun 09 '17 20:06 rtone1

Same issue here. Dynamically disabling radio buttons in a group (and updating validator) will cause validation to no longer trigger on that group. Validation works fine on those radio buttons before dynamically updating the disabled attribute on any of them.

hellodaylight avatar Jul 16 '18 15:07 hellodaylight