Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attributes.Add("onclick") causes validators to stop working

Status
Not open for further replies.

Billkamm

Programmer
Feb 9, 2006
74
US
I added the following line of code to my codebehind and my Validators stopped working. What can I do to make my validators continue to work and still be able to use a confirm() call with the onclick event?

btnSubmit.Attributes.Add("onclick", "return confirm('You are about to submit a new application.
Continue?');")
 
Found it:

btnSubmit.Attributes.Add("onclick", "if (!confirm('You are about to submit a new application. Continue?')) return false;")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top