Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 26th, 2006, 04:28 AM
Registered User
 
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ganga
Default Passing data from modal dialog to window.

Hi,

   I developed code for modal window.But I am unable to pass the data from modal dialog to window.

Here is my code and details:

This is the code for "main.html".

     <HTML>
    <HEAD>
        <SCRIPT LANGUAGE="JavaScript">
            function topWindowShowModal()
            {
            window.showModalDialog("modal-window.html","window","dialogHeight=30;dialogWidth =50;scrollbars=yes");
            }
        </SCRIPT>
    </HEAD>
    <BODY>
       <CENTER>
          <FORM method=post name=parent>
             <pre>
             Text Field1: <INPUT TYPE="TEXT" name="fillingtext1" id="tf1">
             Text Field2: <INPUT TYPE="TEXT" name="fillingtext2" id="tf2">
             <INPUT TYPE="BUTTON" VALUE="ShowModal" onClick="topWindowShowModal()">
             </pre>
          </FORM>
       </CENTER>
    </BODY>
</HTML>


This is the code for "modal-window.html".

<html>
    <head>
        <title>Modal</title>
    </head>

    <body leftmargin="0" topmargin="0" bgcolor="BDCDE6">
        <table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="5"></td>
        </tr>

        <tr>
            <td height="80" align="left" valign="top">
                <table width="300" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="25" height="20" align="center">
                            <input name="textfield10112" type="radio" />
                        </td>
                        <td width="25" height="20" align="center">
                            <input name="textfield10112" type="text" class="normaltextbox" size="15" />
                        </td>
                        <td width="25" height="20" align="center">
                            <input name="textfield101122" type="text" class="normaltextbox" size="15" />
                        </td>
                    </tr>

                    <tr>
                        <td width="25" height="20" align="center">
                            <input name="textfield10112" type="radio" />
                        </td>
                        <td width="25" height="20" align="center">
                            <input name="textfield10112" type="text" class="normaltextbox" size="15" />
                        </td>
                        <td width="25" height="20" align="center">
                            <input name="textfield101122" type="text" class="normaltextbox" size="15" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>

        <tr>
            <td>
                <table border="0" cellspacing="1" cellpadding="2">
                    <tr>
                        <td>
                        <input type="button" name="Fill" value="Fill" class="normalbutton"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        </table>
    </body>
</html>


In "main.html" I took 2 text fields.
In "modal-window.html" I took radio buttons and text fields.

The task is,
  1) Enter values for text fields of "modal-window.html";
  2) Select a radio button;
  3) Then on clicking the "fill" button the respective radio button row data should be filled in the "main.html" 'textfield1','textfield2' respectively.

Please help me in this task.

Thanks&Regards
Ganga Krishna.




Thanks&amp;Regards
Ganga Krishna Yenishetty
 
Old September 26th, 2006, 06:45 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Look at the documentation for showModalWindow on msdn.com. The function returns an object, which can be anything. You set the value of the object in the modal window using self.returnValue = <my data here>

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Classic ASP - how to export data from modal window calgarychinese Classic ASP Basics 1 November 14th, 2006 09:11 AM
how to return value from modal dialog ajaypsingh Javascript 2 May 16th, 2006 05:14 AM
Modal Dialog window Problem anandham Javascript 7 February 16th, 2005 06:08 PM
download dialog problem in modal window jaisonkmathews Javascript 2 February 11th, 2005 08:57 AM
Modal dialog window eldanh ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2004 02:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.