Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controlling Button click events

Status
Not open for further replies.

Ken100

Programmer
Oct 29, 2007
6
US
Hi Guys

I am developing a form in which a window should popup when the user abondons the page.
This page contains 3 buttons.
1) Submit button
2) cancel button
3) goback button.

This popup window should popup in all the cases except the user clicks on
submit button.
I have written a javascript function which will popup a window.
But I dont know how to control as per the event.
Any help will be appreciated.

Here is the javascript function
@@@@@@@@@@@@@@@@

Code:
function SurveyPopup() {
if (window.showModalDialog)
{
Surveywindow=window.showModalDialog('Popup.htm','Surveywindow','center:yes;dialogWidth:300px;dialogHeight:200px')
}
else
{
Surveywindow=window.open("Popup.htm","Surveywindow","location=1,width=300,height=200,menubar=0,resizable=0,modal=yes")
}
}
}

</script>

</head>
<body onunload="SurveyPopup()">
@@@@@@@@@@@@@@@@@@@@

Thanks in advance
 
I'd bet you didn't do a search on the term onunload here in the Javascript forum. The question has been asked and answered several times.

Lee
 
I didnt find anything useful info for my question .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top