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

Ranhiru Cooray edited this page Jun 7, 2017 · 3 revisions

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

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

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