Hello,
I have a custom template for my order add pages that dynamically adjusts to show/hide relevant fields based on the order type selector at the top. To do so it uses the change event withing Client Scripts -> Table-Specific -> Add/Copy Page -> Startup Script
$("select[name='x_OrderType']").change(function() {
//Some code here to show/hide fields when this selection is changed
}
$("input[name='x_OrderType]").trigger('change');
I also have code in Form_CustomValidate that validates some fields before submission.
I discovered an edge case that prevents users from saving the order if they trigger a Form_CustomValidate error and then attempt to change the order type without first clearing the error. If that field is hidden using the code in Startup Script the error is hidden along with it before the error is cleared preventing the user from saving the order.
So is there a way to clear all validation errors within the Startup Script change event above?