Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

How To: HTML5 validation in hidden fields

jawa edited this page Feb 21, 2013 · 3 revisions

The hidden fields are being validated by the parameter required in HTML5.

To remove this parameter when removed fields are hided you could use the following snippet:

jQuery(function ($) {
  $(document).on('nested:fieldRemoved', function (event) {
    $('[required]', event.field).removeAttr('required');
  });
});