HighDots Forums  

Form Submittal In Multiple Windows?

Javascript JavaScript language (comp.lang.javascript)


Discuss Form Submittal In Multiple Windows? in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Floria
 
Posts: n/a

Default Form Submittal In Multiple Windows? - 10-08-2003 , 10:37 AM






Hello,

I have several links on my page that run reports. Each link submits a
seperate form. The onclick event of the link opens a new named window
where I control the "chrome". The form's target is set to that new
window.

This works as expected, but is not exactly what we need. We'd like to
open a new window with no features for each click of the link (So the
user can see the previous report, since it may have been run using
different paramters). Currently each click of the link displays the
report in the same window that was previously opened. Is this
possible?

Reply With Quote
  #2  
Old   
Dom Leonard
 
Posts: n/a

Default Re: Form Submittal In Multiple Windows? - 10-12-2003 , 08:33 AM






John Floria wrote:

Quote:
I have several links on my page that run reports. Each link submits a
seperate form. The onclick event of the link opens a new named window
where I control the "chrome". The form's target is set to that new
window.

This works as expected, but is not exactly what we need. We'd like to
open a new window with no features for each click of the link (So the
user can see the previous report, since it may have been run using
different paramters). Currently each click of the link displays the
report in the same window that was previously opened. Is this
possible?
You could try changing the target attribute of the report form as each
report is opened, along the lines of:

----

var featureString="height=400,width=600";
var windowCount=0;
var windowName="myReportWindow";
function tryIt( oForm)
{
var nextWindowName=windowName + (windowCount++);
oForm.target = nextWindowName;
window.open("", nextWindowName, featureString);
return true;
}

....
and in HTML
....

<form name="report0" action="report0.php" onsubmit="tryIt(this)">
...
<input type="submit"
value="trial report0 with these values (opens new window)">
</form>

------

Technially seems to checkout in Mozilla 1.4, IE6.0 and Opera 7.2 (with
preferences set to allow unrequested popups of course).



HTH

Dom






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.