G
Guest
I can create Javascript confirm message boxes during page creation, etc
adding them to the button attributes (many good posts on this!). But how can
I add this event after the button is pressed?
I have created an Is_Dirty routine checking for field changes on my page
then if the user clicks on the "exit" button I check for Is_Dirty = true and
want to ask then "do you want to exit without saving?". It's a code behind
where if the value of Is_Dirty = True then I want to display the messagebox
with return confirm. So if the user clicks "cancel" then they are back on the
form.
I've tried:
1.) But return can not be used in front of confirm, I get an error, but
works without confirm.
Dim popupScript As String = "<script language='javascript'>" & _
"confirm(""Are you sure you want to exit without saving
changes?"");" & _
"</script>"
Response.Write(popupScript)
Any ideas? thanx.
adding them to the button attributes (many good posts on this!). But how can
I add this event after the button is pressed?
I have created an Is_Dirty routine checking for field changes on my page
then if the user clicks on the "exit" button I check for Is_Dirty = true and
want to ask then "do you want to exit without saving?". It's a code behind
where if the value of Is_Dirty = True then I want to display the messagebox
with return confirm. So if the user clicks "cancel" then they are back on the
form.
I've tried:
1.) But return can not be used in front of confirm, I get an error, but
works without confirm.
Dim popupScript As String = "<script language='javascript'>" & _
"confirm(""Are you sure you want to exit without saving
changes?"");" & _
"</script>"
Response.Write(popupScript)
Any ideas? thanx.