親ページと子ページ('empW.cfm')があります。これは、親ページのフォームフィールドの1つにあるポップアップウィンドウにすぎません。<cfform>
親ページで使用しています。このChild-page-popup-windowから、Parent-pageの関連するフォームフィールドにデータを入力したいと思います。どうしても試しましたが、今まで成功しませんでした。
親ページ:-
<script type="text/javascript" src="test.js" >
function doSubmit() {
var Emp = document.getElementById("emp");
var getName = document.getElementById("getName");
Emp.value = getName.value;
}
</script>
</head>
<body>
<cfajaximport tags="cfform,cfwindow">
<cfform action="Action.cfm" name="formE" id="formE" preserveData="true" enctype="multipart/form-data" method="post" onsubmit="return validate(document.formE);" >
<table >
<tbody>
<tr><td > Name*: </td><td><cfinput name="Name" id="Name" type="text" ></td></tr>
<tr><td > EMP:</td>
<td><input name="searchName" id="emp" onClick="createWindow('empW.cfm')"></td>
</tr>
</tbody>
</table>
</cfform>
子/ウィンドウページ:-
<!--- empW.cfm --->
<cfform name="formI" id="formI" preserveData="false" method="post">
<table>
<tr><td>
<cfif isdefined('form.getName')>
<cfoutput>Selected = #form.getName#!</cfoutput>
<cfelse>
Selected =
</cfif>
</td></tr>
<tr>
<input name="getName" id="getName" type="text" value="Find emp name" >
<input name="Add" id="getName" type="submit" onChange="doSubmit();">
</td></tr>
</table>
</cfform>
助けてください。