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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 web forms

Status
Not open for further replies.

LeoLionHeart

Programmer
Joined
Apr 4, 2006
Messages
45
Location
GB
I have two web pages 1 web page is the master and the second is a small window that pops up. On my small window I have a hidden input box which is the result of the selected index from a list box.

What I have on my main page is a text box which I want to be populated from the hidden input box via Javascript.

Code:
function Display_Sec()
		{

			var name=document.Form1.savelistIndex.value;
			alert(name);
			document.parentWindow.item("txtSec").value = name;
			window.close();
		}

any ideas how to get the hidden value onto the master form.

This isn't working
document.parentWindow.item("txtSec").value = name;
 
Add this code to your popup window.
Code:
window.opener.[i]form_name.field_name[/i].value = value;
Note: This needs to be adjusted to fit your parent form layout.

M. Brooks
 
Nice one. This works fine apart from closing the window at the end.

Code:
function PopulateSecretary()
{
var name=document.getElementById("savelistIndex").value;
opener.document.getElementById("txtSec").value = name;
window.close;
}

Any ideas why the window won't close?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top