Here\'s the use case:
I have this long form with group of field that only becomes visible if the user makes a certain selection in one of the visible inputs. Reading
Do not remove and re-attach rules. Just disable
or enable
inputs. Disabled fields do not participate in validation, neither do they get submitted to server.
//disable inputs. No validation will occur on these
$('.data-panel').find('input[type="text"], textarea, select').attr('disabled', 'disabled');
//enable inputs. Validation is re-enabled
$('.data-panel').find('input[type="text"], textarea, select').removeAttr('disabled');