You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.
Currently I have a set of radio buttons that trigger bootstraps collapse method for a div which contains a few text inputs.
The collapse is triggered with jQuery and the update is triggered on Bootstraps hidden.bs.collapse event: $("#rentingInfo").on('hidden.bs.collapse shown.bs.collapse', function(){ $("#whereForm").validator('update'); });
The text inputs that are shown are required if they are visible. I have edited the validator selector to: Validator.INPUT_SELECTOR = ':input:visible:not([type="hidden"], [type="submit"], [type="reset"], button)'
So what should happen, is the form must be valid if the text inputs are hidden (which they are by default) and invalid if they are visible and empty.
As far as I can tell, the form does validate, however it does not toggle the submit buttons disabled state. IE: The submit button is enabled when the form is loaded as the text inputs are hidden by default. When I toggle the radio button, the text inputs are shown, but the button remains enabled, however, when I click on the submit button, it becomes disabled and highlights the fields as invalid. Now with the button in the disabled state, I toggle the radio button which hides the text fields, which makes the form valid again, but the submit button still remains disabled, however, when I click the disabled submit button, it enables it and submits the form sucessfully.
The text was updated successfully, but these errors were encountered:
Currently I have a set of radio buttons that trigger bootstraps collapse method for a div which contains a few text inputs.
The collapse is triggered with jQuery and the update is triggered on Bootstraps hidden.bs.collapse event:
$("#rentingInfo").on('hidden.bs.collapse shown.bs.collapse', function(){ $("#whereForm").validator('update'); });
The text inputs that are shown are required if they are visible. I have edited the validator selector to:
Validator.INPUT_SELECTOR = ':input:visible:not([type="hidden"], [type="submit"], [type="reset"], button)'
So what should happen, is the form must be valid if the text inputs are hidden (which they are by default) and invalid if they are visible and empty.
As far as I can tell, the form does validate, however it does not toggle the submit buttons disabled state. IE: The submit button is enabled when the form is loaded as the text inputs are hidden by default. When I toggle the radio button, the text inputs are shown, but the button remains enabled, however, when I click on the submit button, it becomes disabled and highlights the fields as invalid. Now with the button in the disabled state, I toggle the radio button which hides the text fields, which makes the form valid again, but the submit button still remains disabled, however, when I click the disabled submit button, it enables it and submits the form sucessfully.
The text was updated successfully, but these errors were encountered: