[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Write value from child to main window

Posted on 2001-06-25
3
Medium Priority
?
278 Views
Last Modified: 2013-12-24
I have 2 forms. One is the main.cfm window and the second is the child.cfm window.  I would like to click on a link on the child window and write back to the main window (in the textbox called strTest).

main.cfm
<SCRIPT LANGUAGE = "JavaScript">
window.open('child.cfm','child','width=200,height=220')
</SCRIPT>
<form name="FormName">
<input type="text" name="strTest" value="">
</form>

child.cfm
<SCRIPT LANGUAGE = "JavaScript">
 function FormOpener(textfield)
{
  window.opener.document.FormName.strTest.value = fromthelink; (i don't know how to point to the link)help
  window.close();
}
</script>

<cfQuery name="GetName" datasource="#application.link#" dbtype="ODBC">
Select Name
From Employee
Group by Name
</cfquery>

<cfoutput query="GetName">
<A HREF = "javascript:FormOpener(#trim(Form_Name)#)">#trim(Form_Name)#</A><br>
</cfoutput>

0
Comment
Question by:tb20
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:tb20
ID: 6224858
I figured out the answer.
0
 
LVL 4

Accepted Solution

by:
CF_Spike earned 200 total points
ID: 6224910
I think this is what you want:


main.cfm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
     <title>Parent</title>
</head>

<body>

<SCRIPT LANGUAGE = "JavaScript">
window.open('child.cfm','child','width=200,height=220')
</SCRIPT>
<form name="FormName">
<input type="text" name="strTest" value="">
</form>




</body>
</html>

child.cfm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
     <title>Child</title>
</head>

<body>

<SCRIPT LANGUAGE = "JavaScript">
function FormOpener(textfield)
{
 window.opener.document.FormName.strTest.value = textfield;
 window.close();
}
</script>

<CFSET GetName = QueryNew('Name')>
<CFSET NULL = QueryAddRow(GetName)>
<CFSET NULL = QuerySetCell(GetName,'Name','Spike')>
<CFSET NULL = QueryAddRow(GetName)>
<CFSET NULL = QuerySetCell(GetName,'Name','Bob')>
<CFSET NULL = QueryAddRow(GetName)>
<CFSET NULL = QuerySetCell(GetName,'Name','Fred')>
<CFSET NULL = QueryAddRow(GetName)>
<CFSET NULL = QuerySetCell(GetName,'Name','Jim')>
<CFSET NULL = QueryAddRow(GetName)>
<CFSET NULL = QuerySetCell(GetName,'Name','Bill')>

<cfoutput query="GetName">
<A HREF = "##" ONCLICK="Javascript: FormOpener('#trim(Name)#');">#trim(Name)#</A><br>
</cfoutput>


</body>
</html>

Spike
0
 

Author Comment

by:tb20
ID: 6224945
Thanks but i was able to get it to work.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question