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&Regards
Ganga Krishna Yenishetty
|