I have an "email edit form" that requires an email if it is being submitted: However, if the form is rejected, we do not need an email as it is going back to the previous step.
I added this script "when reject button is click, ignore required fields"
$(document).ready(function() {
$( ".action-btn.Reject" ).on('click', function() {
$(" [required]").each(function() {
$( this ).removeClass( 'required' );
$( this ).removeAttr( 'required' );
});
});
});
Now when we hit reject, I get this:
Any help is appreciated, thank you.