RequiredFiled Validator with Javascript Confirmations

liunx

Guest
Hi,

I have a form which has a required field validator. At the time of submitting the form to save the values into a database, I also want to confirm from the user if he wishes to continue.

so for my submit button I did the following:
this.saveButton.Attributes.Add("onclick", "return confirm('Are you sure you want to continue?');");

Now, when I click the save button leaving the required field as blank, it pops the confirmation and goes ahead with saving with empty value and the validator does not show any message. I need the validators to show the error message before the pop up.

I do not want the validators to show a message after the confirmation pop up, i know how to do that. I want the validator message before popup.

Please let me know asap.

Thanks in advance :)
 
Back
Top