Subject: Passing data from modal dialog to window.
Posted By: ganga Post Date: 9/26/2006 4:28:33 AM
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
Reply By: joefawcett Reply Date: 9/26/2006 6:45:47 AM
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)

Go to topic 49858

Return to index page 165
Return to index page 164
Return to index page 163
Return to index page 162
Return to index page 161
Return to index page 160
Return to index page 159
Return to index page 158
Return to index page 157
Return to index page 156