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

lest edited this page Sep 17, 2012 · 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).remoteAttr('required');
  });
});