I have a form that is loaded from a User Task. It has buttons to Approve, Submit, or Reject, with custom naming of those buttons.
In the case of the Reject Button, it routes the form to another employee to request assistance with the form.
I want the form to only require completion of fields when approved or submitted, but allow incomplete fields on reject (since I'm routing to that other employee to help complete that form.
This is the code I'm using:
$(".action-btn.Reject").on('click', function() { $('*[required]').each(function() { $(this).removeClass('required') $(this).removeAttr('required'); }); });
When I tested this with the Submit button in the form preview, it worked, so I changed it to the Reject button and then went to test it in the live processing of the form.
Initially the form appears to accept the "reject" button click, but then comes back with an error.
So it appears that there are two layers of required field validation, and I've managed to remove the required field flags that are used in the first validation (while the form is still displayed) but I'm still catching the secondary validation (after the form has been removed from display).
I'm on version 10.2
Anyone have any suggestions?