Adding Javascript confirmation dialog to LinkButton / Form generates Expected error object

I am trying to add a javascript confirmation dialog to either my onclick event or my onsubmit form.

None of them work as I get an "object expected" error in the browser.


frm.Attributes.Add("onsubmit", "return Confirm('Really do this?')")

      

How can I add a confirmation dialog to onsubmit or onclick events without generating an "expected object" error?

0


a source to share


3 answers


Confirm method must be all lowercase letters

Example



confirm('Really do this?')

      

+3


a source


use OnClientClick="return confirm('Message')"



0


a source


Using these legendary coincidences. How about some jQuery BlockUIs?

http://malsup.com/jquery/block/#dialog

-1


a source







All Articles