window closing event
-
have a button in the web page.now on closing the form i am showing the confirm message(are u sure u want to exit). for that i am writing the following code.
function abc() { if(confirm('Are u sure u want to exit')==true) { return true; } }
but the above code shows me the message box when i click the button.i want the message box to appear when i click the close button. Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1 -
have a button in the web page.now on closing the form i am showing the confirm message(are u sure u want to exit). for that i am writing the following code.
function abc() { if(confirm('Are u sure u want to exit')==true) { return true; } }
but the above code shows me the message box when i click the button.i want the message box to appear when i click the close button. Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1When a button is clicked, obviously this event will fire because you are navigating away from page. To workaround with this issue, make a public variable (JS) and when button is clicked, make this variable value to
true
. Else it should befalse
. In your unload function check the status of this variable and show appropriate messages.
-
have a button in the web page.now on closing the form i am showing the confirm message(are u sure u want to exit). for that i am writing the following code.
function abc() { if(confirm('Are u sure u want to exit')==true) { return true; } }
but the above code shows me the message box when i click the button.i want the message box to appear when i click the close button. Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1 -
have a button in the web page.now on closing the form i am showing the confirm message(are u sure u want to exit). for that i am writing the following code.
function abc() { if(confirm('Are u sure u want to exit')==true) { return true; } }
but the above code shows me the message box when i click the button.i want the message box to appear when i click the close button. Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1you can call your javascript methos (that showing confirm message) on "BeforeWindowClose" event of window object in javascript. in this case if a user click on the close button it fires before closing the window.
Pankaj Gupta (Take it easy)
-
you can call your javascript methos (that showing confirm message) on "BeforeWindowClose" event of window object in javascript. in this case if a user click on the close button it fires before closing the window.
Pankaj Gupta (Take it easy)
Hello Pankaj ... Pankaj how can i write the code it i click yes on the confirm message box.Actually i had to write some code on clicking yes.before the window gets closed. Please help....
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
-
have a button in the web page.now on closing the form i am showing the confirm message(are u sure u want to exit). for that i am writing the following code.
function abc() { if(confirm('Are u sure u want to exit')==true) { return true; } }
but the above code shows me the message box when i click the button.i want the message box to appear when i click the close button. Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1 -
Hello Pankaj ... Pankaj how can i write the code it i click yes on the confirm message box.Actually i had to write some code on clicking yes.before the window gets closed. Please help....
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
u wana close the window when u click the close the button
Piyush Vardhan Singh
-
Hello Pankaj ... Pankaj how can i write the code it i click yes on the confirm message box.Actually i had to write some code on clicking yes.before the window gets closed. Please help....
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
u use this one page load Button1.Attributes.Add("OnClick", "self.close()")
Piyush Vardhan Singh
-
Hello Pankaj ... Pankaj how can i write the code it i click yes on the confirm message box.Actually i had to write some code on clicking yes.before the window gets closed. Please help....
Soniagupta1@yahoo.co.in Yahoo Messenger Id = soniagupta1
window.onbeforeunload = forClose; function forClose() { mess = "You will lose all information provided\nduring navigation of this site"; return mess; } You can use the above code, to confirm while navigating from this page. in the mess variable you can use your message. if you have still any issue mail me. Pankaj Gupta (Take it easy)