Displaying modal dialog box on click of button after validating data entered by user under form fields
In my application there is a requirement to display a modal dialog box containing an alert message with Ok and Cancel button. This modal dialog box is to be displayed on click of a button in form which has some form fields like text fields, dropdowns, checkboxes etc.
On click of button the value under two dropdown fields (under form) need to be validated and if the validation fails then only modal dialog box is to be displayed. If modal dialog box is displayed, then on click of Ok the form needs to be submitted to server for further processing but if user clicks cancel then nothing should happen and modal dialog box should close.
I'm new to Pega, pardon me if I'm not using Pega jargons for controls or fields.
I was reading the documentation and found that Pega supports AJAX. AJAX can be used for user interface events such as Visible When. I further found that user interface events can be used to automatically trigger actions like launching a model dialog.
Please suggest if I'm looking in the right direction or else how this requirement can be achieved.