views:

570

answers:

2

I am attempting to add a javascript confirm dialog to either my linkbutton onclick event or my form onsubmit event.

Neither of them work as I receive an 'object expected' error from the browser.


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

How do I add a confirm dialog to the 'onsubmit' or 'onclick' events without generating an 'object expected' error?

+3  A: 

confirm method should be all lowercase letters

Ex

confirm('Really do this?')
Gordian Yuan
Yes. Thank you friend.
+1 for spotting the casing for the function call.
Jose Basilio
A: 

Still using those legendary conform boxes. How about some JQuery BlockUI?

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

azamsharp