Hi,
I have a page on one of my projects that is an email form with the four following fields:
Sender's Name - (Required)
Sender's Email Address - (Required)
Subject - (Not Required)
Body - (Required)
I wanted to use Javascript to display a confirm message that asks the user if they are sure they want to leave the subject blank when sending the email. To do this I inserted the following into the OnClientClick property of my Send button:
return confirm('Send this email without a subject ')
With all of the fields blank, I clicked send and the javascript message I created above is displayed.
The problem: The validation for my three required fields is ignored and if I confirm that I'd like to send the email without a subject the email sends with no information in any of the fields.
Question: Is is possible to make the validation take priority over the OnClientClick property to check and see if the required fields are populated first If it's not possible are there any suggestions as to how I can deal with this problem
I know I could solve this by simply making all of the fields required, but I'd like to give the user the option of leaving the subject line blank. Any help is greatly appreciated!