Basic Customization > User Interface Customization > Presenting Information in the UI > UI Validation > Solutions > Procedures – Post-Submit Validation > How to Handle UIValidationStatus.PROMPT_FOR_CONFIRMATION
  
How to Handle UIValidationStatus.PROMPT_FOR_CONFIRMATION
If your validator retuns PROMPT_FOR_CONFIRMATION status, it needs to be specially configured.
Option 1: Use your own custom ok/apply wizard button by using PTC.validation.AJAXValidateFormSubmission JavaScript function.
<action name="myOkButton" id="PJL_wizard_ok" >
<command class="" method="" windowType="page" url=" javascript:PTC.
validation.AJAXValidateFormAndSubmit(validationKey)"/>
</action>
In this case, once you click myOkButton:
PTC.validation.AJAXValidateFormAndSubmit function based on the provided validationKey executes post-submit functions on the mapped validator.
If the status is PROMPT_FOR_CONFIRMATION, confirmation pop-up will be shown and based on your selection further processing will happen.
If you opt for “yes” for the confirmation or the status was PERMITTED, the form will be submitted. There is inbuilt intelligence not to invoke your validator again for this request.
Option 2: Add your own user submit function in your jsp (invoked when the form is submitted) by using PTC.validation.AJAXValidateFormSubmission JavaScript function.
<script type="text/javascript">
setUserSubmitFunction (function () {return PTC.validation.
AJAXValidateFormSubmission(validationKey);});
</script>
In this case, once you have ok/finish wizard button :
PTC.validation.AJAXValidateFormSubmission function based on the provided validationKey executes post-submit functions on the mapped validator.
If the status is PROMPT_FOR_CONFIRMATION, confirmation pop-up will be shown and based on your selection further processing will happen.
If you opt for “yes” for the confirmation or the status was PERMITTED, the ok/finish wizard button submits the form. There is inbuilt intelligence not to invoke your validator again for this request.