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

problem popup window

Status
Not open for further replies.

tachyon80

Technical User
Joined
Jun 19, 2004
Messages
13
Location
US
I've got a great popup window for my form but it can't handle a hidden value. What do I change in the code below to make my hidden country field appear on the main window?

Code:
<html>
<head>
	<title>U.S. Address</title>
<script language="Javascript" type="text/javascript">
<!-- hide script from old browsers
function updateParent1(textField){
opener.document.contactinfo.address.value=textField.value
}
function updateParent2(textField){
opener.document.contactinfo.city.value=textField.value
}
function updateParent3(textField){
opener.document.contactinfo.state.value=textField.value
}
function updateParent4(textField){
opener.document.contactinfo.zip.value=textField.value
}
function updateParent5(textField){
opener.document.contactinfo.country.value=textField.value
}
// end hiding -->
</script>
</head>

<body>
<form action="none" onSubmit="window.close()">
address: <input type="text" onblur="updateParent1(this)"><br>
city: <input type="text" onblur="updateParent2(this)"><br>
state: <input type="text" size="2" maxlength="2" onblur="updateParent3(this)"> zip: <input type="text" onblur="updateParent4(this)"><br>
country: USA<br><br>
<input type="hidden" value="USA" onblur="updateParent5(this)">
<input type="submit" name="submit">
</form>

</body>
</html>
 
a hidden field will never have focus, and so will never fire onblur.

how about instead:
Code:
<form action="none" onSubmit="[b]updateParent5(this.country); [/b]window.close()">

<input type="hidden" [b]name="country" [/b]value="USA" />

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top