How to close the popup window when submitting the form?
I have a sample.jsp. In that page one button is there.
when button pressed, open popup window contains one "text box" and one " submit button". when "submit" button pressed, call the "servlet" in this popup window and then close the "popup" window.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var X = 200; // change the # at the left for a fixed X co-ordinate to accommodate browsers other than IE or NS
var Y = 200; // change the # at the left for a fixed Y co-ordinate to accommodate browsers other than IE or NS
if (navigator.appName.indexOf("Netscape")!=-1) {
document.captureEvents(Event.MOUSEMOVE)
function getcoords(e) {
X = parseInt(e.screenX) - 80; // change the # at the left to further adjust the left-margin depending on the size of the window
Y = parseInt(e.screenY) - 60; // change the # at the left to further adjust the top-margin depending on the size of the window
return true;}
document.onmousemove = getcoords;
function openWin() {
if (navigator.appName.indexOf("Microsoft")!=-1) {
X = parseInt(event.screenX) - 80; // change the # at the left to further adjust the left-margin depending on the size of the window
Y = parseInt(event.screenY) - 60; } // change the # at the left to further adjust the top-margin depending on the size of the window
display=window.open('','NewWin','menubar=0,locatio n=no,status=no,directories=no,toolbar=no,scrollbar s=yes,height=30,width=230')
message="<font face='verdana, arial, helvetica, san-serif' size='2'>";
message+="<form name='form1' action='./SaveFile' onsubmit='form1.submit(); self.close();' >";
message+="Enter Query Name:";
message+="<input type='text' name='query_name' />";
message+="<input type='submit' value='GO'/>";
message+="</form></font>";
display.moveTo(X,Y);
display.document.write(message); }
}
// End -->
</script>
The above code didn't call the "servlet" but cose the popup window.
I want to call the "servlet" and then close the popup window.
plz help me, how to close the popup window after submitting the form in popupwindow.



Reply With Quote


Bookmarks