[thelist] JavaScript: Passing form fields to popup NOT through URL

Brett Stinson bstinson at bscs.biz
Thu Jul 10 11:02:28 CDT 2003

  Try this....


<script type="text/javascript">
var popWin = window.open(paychecks_print.cfm, 'printCheck',
popWin.document.printchecks.paychecks_print.checknums.value =
popWin.document.printchecks.paychecks_print.payrollnums.value =

Brett Stinson
bstinson at programmer.net

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org]On Behalf Of Kyle Murphy
Sent: Thursday, July 10, 2003 10:41 AM
To: Thelist at Lists. Evolt. Org
Subject: [thelist] JavaScript: Passing form fields to popup NOT through

Here's my scenario.  I have a button on my page that opens up a popup window
& passes two URL variables (checknums & payrollnums).  Problem is, these
variables end up being too long for the 2,084 characters that IE allows in a
URL, so some get left off (or I get an error).

So, I need a way to pass those variables over to the popup, but not through
the URL.

I have been told to do the following through JavaScript:
1.) Open the popup window
2.) Set form variables in the opener
3.) Set form's target to popup
4.) Submit form.

I'm an amateur Javascript/DHTML writer, still, so I can't quite figure out
how to do this.  Here's what I tried in my opening page:


<script type="text/javascript">
window.open(paychecks_print.cfm, 'printCheck', 'toolbar=0,scrollbars=1');
document.printchecks.paychecks_print.checknums.value = #allchecknumbers#;
document.printchecks.paychecks_print.payrollnums.value = #allpayrollnumber#;


It doesn't work.  I get an "Object Not Found" JS error (as usual)!

How do I give the opening page a "name" or "id"?  Is that what 'printCheck'
is in the first line above?  I'm sorry I sound so stupid, but I can't seem
to figure this one out & I don't want to use session variables or anything
else to do this one-time passing of variables.


* * Please support the community that supports you.  * *

Evolt.org conference in London, July 25-27 2003.  Register today at

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !

More information about the thelist mailing list