Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Entering values to textbox in a parent window

Status
Not open for further replies.

CzechNET

Programmer
Nov 2, 2004
28
0
0
CA

Hello,

I have a window that has a textbox in a form called FRM, now from this window I have a pop-up that contains an image. When this image is clicked the textbox in the parent window would have a value "Something" (example). Is this doable ? If so can you point me to the right direction ? Thanks in advance.
 
try something like this:
Page1: test.html
Code:
<script language=javascript>
function popup() {
   window.open("test2.html");
}
</script>
<body>
<form name=blahForm>
<input type=text name=blahText>
<input type=button value='pop up window' onclick='popup()'>
</form>
</body>

Page2: test2.html
Code:
<script language=javascript>
function populateText() {
   window.opener.document.forms["blahForm"].elements["blahText"].value = "something"
}
</script>
<body>
<input type=button value='populate text field' onclick='populateText()'>
</body>

-kaht

Do the chickens have large talons?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top