SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Closing a window and returning to the window that opened it

    I have a form with a radio button that when selected will open another form (in another window). The user will enter data on this form also, which will be submitted to a DB.

    What I need to happen is when the submit button is hit, the data is submitted and the window closes going back to the original form that will be completed and submitted, but what actually happens is that the data is submitted and opens a new version of the window that originally opened it [which is blank] and does not close.

    I've tried using window.close and self.close but did not get the desired results. Is there any javascript code that I can use to achieve the desired results?

    Here's the html code for the form that I want to close after data is submitted...

    Does anyone have any Ideas?

    HTML Code:
    <body>
    <div align="center"><STRONG>QUOTE REQUEST<BR>
    <font size="+1"><EM>ELECTRONICS INFORMATION</EM></font></STRONG></div>
    <P>&nbsp;</P>
    <FORM action="QReqElecInfo.asp" method="post" name="QRequest4a" id="QRequest4a">
    <table>
    <tr>
    <input name="Origin" type="hidden" id="Origin" value="true">
    <td width="125"><strong>TRANSDUCER :</strong> 
                                        
    <td width="395"><input type="radio" name="transducer" value="Analog" onmouseup="changeSet(this);"> Analog
    <input type="radio" name="transducer" value="Digital" onmouseup="changeSet(this);">Digital</td>
    </tr>
    </table>
    <p></p>
    <table width="863">
    <tr>
    <td width="141" valign="bottom"><strong>ANALOG OUTPUT <br> SIGNAL TYPE :  &nbsp;&nbsp;</strong></TD>
    <TD width="313" valign="bottom"><SELECT Name="AnaOut" disabled='disabled'>
                            <option value="Choose Type">Choose Output Type</option>
                            <option value="0 to +10 VDC">0 to +10 VDC</option>
                            <option value="+10 to 0 VDC">+10 to 0 VDC</option>
                            <option value="-10 to +10 VDC">-10 to +10 VDC</option>
                            <option value="+10 to -10 VDC">+10 to -10 VDC</option>
                            <option value="4 to 20 MA">4 to 20 MA</option>
                            <option value="20 TO 4 MA">20 TO 4 MA</option>
                            <option value="0 to 20 MA">0 to 20 MA</option>
                            <option value="20 to 0 MA">20 to 0 MA</option>
                            <option value="OTHER">OTHER</option>
                            </select></td>
                            
    <td width="134"><strong>DIGITAL OUTPUT <br> SIGNAL TYPE :  &nbsp;&nbsp;</strong></td>
    <td width="255">        <SELECT Name="DigOut" id="DigOut" disabled='disabled' onChange="changeSet(this);">
                            <option value="Choose Type">CHOOSE OUTPUT TYPE</option>
                            <option value="PWM">PWM</option>
                            <option value="SSI">SSI</option>
                            <option value="CAN_BUS">CAN BUS</option>
                            <option value="START/STOP">START/STOP</option>
                            </select></td>
    </tr>
    </table>
    <p></p>
    <table width="806">
    <tr>
    <td width="143" valign="bottom"><strong>INTERROGATION:</strong></td>
    <td width="313" valign="bottom">
                              <SELECT Name="interrogation" disabled='disabled'>
                            <option value="Select One">Select One</option>
                            <option value="PULSE DURATION - INTERNAL INTERROGATION">PULSE DURATION - INTERNAL INTERROGATION</option>
                            <option value="PULSE DURATION - EXTERNAL INTERROGATION">PULSE DURATION - EXTERNAL INTERROGATION</option>
                            <option value="START/STOP PULSE">START/STOP PULSE</option>
                            </select></td>
    <td width="161" valign="bottom"><strong>RECIRCULATIONS:</strong></td>
    <td width="576" valign="bottom"><INPUT Name="recirc" type="text" size="25" maxlength="25" disabled='disabled'>
    </tr>
    <TR>
    </table>
    <p></p>
    <table>
    <td width="161" valign="bottom"><strong>DATA LENGTH:</strong></td>
    <td width="161" valign="bottom"><strong>Format:</strong></td>
    <td width="576" valign="bottom"><INPUT Name="format" type="text" size="25" maxlength="25" disabled='disabled'></td>
    <td width="161" valign="bottom"><strong>Resolution:</strong></td>
    <td width="576" valign="bottom"><INPUT Name="resolution" type="text" size="25" maxlength="25" disabled='disabled'></td>
    <td width="161" valign="bottom"><strong>Performance:</strong></td>
    <td width="576" valign="bottom"><INPUT Name="performance" type="text" size="25" maxlength="25" disabled='disabled'></td>
    <td width="161" valign="bottom"><strong>Options:</strong></td>
    <td width="576" valign="bottom"><INPUT Name="opts" type="text" size="25" maxlength="25" disabled='disabled'></td>
    </TR>
    </table>
    <p></p>
    <table>
    <tr>
    <td width="95" valign="bottom"><strong>PROTOCOL:</strong></td>
    <td width="175" valign="bottom">
                              <SELECT Name="protocol" disabled='disabled'>
                            <option value="Select One">Select One</option>
                            <option value="device_net">DEVICE NET</option>
                            <option value="can_basic">CAN BASIC</option>
                            <option value="can_open">CAN OPEN</option>
                            </select></td>
    <td width="75" valign="bottom"><strong>Baud Rate: </strong></td>
    <td width="175"><input name="baud_rate" type="text" size="10" disabled='disabled'></td>
    <td width="75" valign="bottom"><strong>Resolution</strong></td>
    <td width="175"><input name="baud_res" type="text" size="25" disabled='disabled'></td>
    
    </tr>
    </table>
    <P></P>
    <P></P>
    <P></P>
    <table height="31">
      <TR><td>**********************************************************************************</td></TR></table>
    <p></p>
    <p></p>
    <p></p>
    <table>
    <tr>
    <td width="104"><strong>SWITCHES:</strong></td>
    <td width="225"><input name="switches" type="radio" value="AC" onmouseup="changeSet(this);">AC
                      <input name="switches" type="radio" value="DC" onmouseup="changeSet(this);">DC</td>
    
    </tr>
    </table>
    <p></p>
    <table width="1034">
    <tr>
    <td width="79" valign="bottom">SWITCH <BR> LOCATION</td>
    <td width="120"><input name="SwitchLoc" type="text" size="20" maxlength="20" disabled='disabled'></td>
    <td width="103" valign="bottom">CONNECTOR <BR> ORIENTATION</td>
    <td width="184"><input name="connector" type="text" size="20" maxlength="20" disabled='disabled'></td>
    <td width="524"><input name="electron" type="radio" value="PNP" disabled='disabled'>PNP 
                    <input name="electron" type="radio" value="NPN" disabled='disabled'>NPN</td>
    </tr>
    </table>
    <p>&nbsp;</p>
    
    <p></p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <div align="center">
    <input type="submit" name="button" value="Submit"  onBlur="window.close();">
    <input type="reset" name="Reset" value="Clear">
    </div>
    </form>
    <p>&nbsp;</p>
    
      
    <Form action="QReqElecInfo.asp" method="post" name="QRequest4b" id="QRequest4b">
    <input name="transducer" type="hidden" size="5" value="<%=Request.Form("transducer")%>">
    <input name="transducer" type="hidden" size="5" value="<%=Request.Form("transducer")%>">
    <input name="AnaOut" type="hidden" size="20" value="<%=Request.Form("AnaOut")%>">
    <input name="DigOut" type="hidden" size="20" value="<%=Request.Form("DigOut")%>">
    <input name="interrogation" type="hidden"  value="<%=Request.Form("interrogation")%>">
    <input name="recirc" type="hidden"  value="<%=Request.Form("recirc")%>">
    <input name="format" type="hidden"  value="<%=Request.Form("format")%>">
    <input name="resolution" type="hidden" size="50" value="<%=Request.Form("resolution")%>">
    <input name="performance" type="hidden" value="<%=Request.Form("performance")%>">
    <input name="opts" type="hidden" value="<%=Request.Form("opts")%>">
    <input name="protocol" type="hidden" size="50" value="<%=Request.Form("protocol")%>">
    <input name="baud_rate" type="hidden" size="5" value="<%=Request.Form("baud_rate")%>"> 
    <input name="baud_res" type="hidden" size="5" value="<%=Request.Form("baud_res")%>"> 
    <input name="switches"type="hidden" value="<%=Request.Form("switches")%>">
    <input name="switches" type="hidden" value="<%=Request.Form("switches")%>">
    <input name="SwitchLoc" type="hidden" value="<%=Request.Form("SwitchLoc")%>">
    <input name="SwitchLoc" type="hidden" value="<%=Request.Form("connector")%>">
    <input name="electron" type="hidden" size="5" value="<%=Request.Form("electron")%>"> 
    <input name="electron" type="hidden" size="5" value="<%=Request.Form("electron")%>">

  2. #2
    SitePoint Addict
    Join Date
    Jun 2006
    Posts
    220
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    probably ths will work for u

    <script language="Javascript" type="text/javascript">
    <!--


    passover('<? echo $fld_name ?>','<? echo $value ?>');

    function passover(fld_name,value)
    {
    target ="window.opener.document.forms['GenericAddForm']."+fld_name+".value";

    cmd = target + "=\"" + value + "\"";
    //alert(cmd);
    eval(cmd);
    window.close();
    }
    //-->
    </script>


Bookmarks

Posting Permissions

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