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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open window on form submit 1

Status
Not open for further replies.

AdzDaz

Programmer
May 28, 2001
4
AU
I want to open a new window on form submit, that submits the page via the new open window.

I got it working, but just very occasionally it opens the new window, then opens another window for the form submission. I'm doing this:

<form name=&quot;form1&quot; method=&quot;post&quot;
action=&quot;MyProgram&quot;
onSubmit=&quot;return openOnSubmit();&quot;
target=&quot;onlinebkngs&quot;>

The target is a window i create via the openOnSubmit() javascript function, as below:

var floater;

function openOnSubmit {
floater = null;

//Build up window attributes via winStats
winStats = &quot;status=yes,toolbar=no,location=no,directories=no,menubar=no,scrollbars,left=10,screenX=10,top=10,screenY=10&quot;;

// Set the size of the window
if (window.screen) {
var ah = screen.availHeight - 60;
var aw = screen.availWidth - 30;
winStats += &quot;,height=&quot; + ah;
winStats += &quot;,innerHeight=&quot; + ah;
winStats += &quot;,width=&quot; + aw;
winStats += &quot;,innerWidth=&quot; + aw;
}
else {
// Allow resize if can't get size
winStats+=&quot;,resizable&quot;;
}

// Set the name of the new window to &quot;onlinebkngs&quot;
// So that can submit form via it
floater=window.open(&quot;&quot;,&quot;onlinebkngs&quot;,winStats)

if (floater && floater.open) // if window opened ok...
return true;
else
return false;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top