...

View Full Version : problem popup form



tachyon
07-05-2004, 01:56 AM
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?


<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>

LynxGrr
07-05-2004, 02:39 AM
Im only a newbie with JS so im probably miles of the mark here, but it appears none of your <INPUT> tags have names. Could that be the problem?

tachyon
07-05-2004, 02:53 AM
It may be an odd script I'm trying to modify but the lack of names isn't a problem. The fields on the parent page have names so it all works out.

My only problem is I can't drop a value into a field from a "hidden" value.

glenngv
07-05-2004, 03:26 AM
Obviously, you can't set focus to a hidden field so onblur event won't be fired.

<input type="hidden" value="USA" onblur="updateParent5(this)">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum