...

View Full Version : Writing form data to another value in a different window



apowers20
10-13-2005, 06:11 PM
Hi Everyone,

Having a little trouble of knowing where to start. I'm trying to take user inputted data options from a popup window form and put it in an existing form behind the current window.

Anyone have any ideas how to do this? Would appreciate any help. Thanks.

nikkiH
10-13-2005, 11:39 PM
From the popup to the window that opened the popup:

self.opener.document.formname.elementname.value="whatever";

apowers20
10-14-2005, 01:32 AM
Thanks for the reply,

Can you be a little more specific? Here is my code, it's a lot of stuff, but I'll list the pertinent spots:

This is in the head:

<script type="text/javascript">

function micradd( name, output ) {

newwin = window.open( '', '', 'toolbar=no', '', 'width=750, height=220' );
if ( !newwin.opener ) newwin.opener = self;
newwin.opener.document.bgColor = "FFFFFF";
with ( newwin.document ) {

open();
write( '<body onLoad="document.checkcustomize.<?php print "F$n"; ?>.focus()">' );
write( '<form name=micrcustomize method=post onSubmit= ' + output + '=this.value;window.close();>' );
//write( ' onSubmit=opener.document.bgColor="FFFFFF";window.close()>' );
write( 'To correctly customize your check, we need the exact ' );
write( '<a href="custom_help.php?help=MICR&from=help">MICR</a> ' );
write( 'spacing that your bank, or lending institution, requires.<br><br>' );
write( '<ol>' );
write( '<li>Click <a href="micrgauge_pdf.php">here</a> to download the printable MICR gauge. (Choose "Save As..." when prompted)</li> ');
write( '<br>' );
write( '<li>Print out the document on your printer.</li>' );
write( '<br>' );
write( '<li>Follow the instructions and fill in the necessary selections below</li> <br><br>' );
write( '</ol>' );

write( '<table border=0 cellspacing=0 cellpadding=0>' );
write( '<?php
for ($n = 56; $n > 0; $n--) {

if ($cols == 8) {

$cols = 0;
print "</tr><tr>";
}

print "<td align=right>$n";
print ":&nbsp;";

print "<select name=F$n>";
print "<option value=x></option>";
print "<option value=0>0</option>";
print "<option value=1>1</option>";
print "<option value=2>2</option>";
print "<option value=3>3</option>";
print "<option value=4>4</option>";
print "<option value=5>5</option>";
print "<option value=6>6</option>";
print "<option value=7>7</option>";
print "<option value=8>8</option>";
print "<option value=9>9</option>";
print "<option value=A>A</option>";
print "<option value=B>B</option>";
print "<option value=C>C</option>";
print "<option value=D>D</option>";
print "</select>";

$cols++;
print "</td>";

}
?>' );
write ( '</table>' );

write( '<br><br>' );
write( '<center>' );
write( '<input type=submit value="Finish">' );
write( '</center></form>' );
close();
}
}
</script>

Now this is the value needing to be changed with the values from the above code:

Note: This part of the code is in a form named "checkcustomize"

<input type="text" size="41" maxlength="56" tabindex="20" name="micr">
<span style="color: #ff0000;">&nbsp;*</span>
&nbsp;&nbsp;Choose from <a href="javascript:micradd('Micr Value', 'opener.document.checkcustomize.micr.value');">here</a>



The Problem is this:
When I click the finish button on the popup window I get an 'undefined' message in the box where I need the values. I also need all 56 spaces defined in the text box. This is for a customer selecting the way their bank information on the bottom of their check is formatted. They use a gauge to determine how the numbering is done and X's if there is nothing selected. Any help to just get the values over would be much appreciated. Thanks for looking. :eek:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum