$("#button").click( function() { alert('button clicked'); } );
You can write the click event for button in jquery like this
Mark this as answer if it helped
window.onbeforeunload = function (e) {
var message = "Message to Show",
e = e || window.event;
// For IE and Firefox
if (e) {
e.returnValue = message;
//// SUBMIT
}
// For Safari
//// PUT SUBMIT
return message;
};
MVP Client Operating System
Please Mark as Answer if it helps :)
I want to execute the functionality of submit() on logout
Put the below code in the OnCLientClick event of the logout button; It will trigger the submit buttons code behind click event __doPostBack("SubmitButtonId", '');
Visit My Blog "A candle loses nothing by lighting another candle."
dotnet_CH
Member
40 Points
278 Posts
Submit() button execution
Jan 29, 2013 05:37 AM|LINK
hi all,
I want to execute the functionality of submit() on logout / browser close in JQuery.
How to fire click event of submit button on these two cases.
thanks
jinu elsa
Member
18 Points
13 Posts
Re: Submit() button execution
Jan 29, 2013 06:37 AM|LINK
$("#button").click( function() { alert('button clicked'); } ); You can write the click event for button in jquery like this Mark this as answer if it helpeddotnet_CH
Member
40 Points
278 Posts
Re: Submit() button execution
Jan 29, 2013 10:56 AM|LINK
sorry, I was unable to put my requirement in correct words.
Actually I want to catch the event for brower close in jquery and further want to trigger submit_click event on that event.
Raigad
Contributor
5131 Points
957 Posts
Re: Submit() button execution
Jan 29, 2013 11:15 AM|LINK
Refer this one
http://eureka.ykyuen.info/2011/02/22/jquery-javascript-capture-the-browser-or-tab-closed-event/
http://api.jquery.com/unload/
Mark as Answer, if the post helped you...
Visit My Blog
giop
Member
378 Points
81 Posts
Re: Submit() button execution
Jan 30, 2013 08:27 AM|LINK
window.onbeforeunload = function (e) { var message = "Message to Show", e = e || window.event; // For IE and Firefox if (e) { e.returnValue = message; //// SUBMIT } // For Safari //// PUT SUBMIT return message; };Please Mark as Answer if it helps :)
mhbalti
Participant
977 Points
350 Posts
Re: Submit() button execution
Jan 30, 2013 02:12 PM|LINK
Put the below code in the OnCLientClick event of the logout button; It will trigger the submit buttons code behind click event __doPostBack("SubmitButtonId", '');
"A candle loses nothing by lighting another candle."