Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Writing form data to another value in a different window

    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.

  • #2
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    From the popup to the window that opened the popup:

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

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #3
    New to the CF scene
    Join Date
    Jul 2005
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by apowers20; 10-14-2005 at 12:34 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •