Question : Passing value from one page textbox to another page textboxes

Hi,
I am newbie in web development specially in javascript. I've two pages, PAGE 1 and PAGE 2. PAGE 2 pops up when user click on PAGE 1 Button A or B. User can fill out ONLY one TextBox on PAGE 2(TextBox A or TextBox B).

If user click on PAGE1, Button A and then fill out anyone TextBox on PAGE2(Whether it is TextBox A or B), the value should populate on Page1, TextBox1. And the same way it works on Button B. I've the codes for both pages which is attached in .htm format.
Attachments:
 
Page1
 
 
Page2
 

Answer : Passing value from one page textbox to another page textboxes

You are close to your answer. In page 2, update the close_window function with this:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
function close_window() {
	   if(document.getElementById('Page2_Txt1').value != "") {
			opener.document.getElementById( gup("target") ).value = document.getElementById('Page2_Txt1').value;
		}
		else if(document.getElementById('Page2_Txt2').value != "") {
			opener.document.getElementById( gup("target") ).value = document.getElementById('Page2_Txt2').value;
		}
		else {
			alert("Fill in one textbox!");
			return;
		}
		window.close();
	}
Random Solutions  
 
programming4us programming4us