it's not happening there ... the label is being changed fine and dandy. like i said, if i change the code to call the setCode() function instead on search(), it works fine. it has something to do with calling the search subroutine first: here is the generated code:
<script>
function setCode()
{
var d = window.opener.document;
d.getElementById('txtDepCity').value = 'jjj';
window.close();
}
</script>
<html xmlns="
>
<head><title>
airport code search
</title></head>
<body>
<form method="post" action="code.aspx" id="form2">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTE2NzIyMzE2NA9kFgICBA9kFgICBA8PFgIeBFRleHQFKTxicj48YSBocmVmPWphdmFzY3JpcHQ6c2V0Y29kZSgpOz5mZXc8L2E+ZGRk4DB3+4WYYrwAA+5O+62Owm+KERI=" />
</div>
<script type="text/javascript">
<!--
var theForm = document.forms['form2'];
if (!theForm) {
theForm = document.form2;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
// -->
</script>
<div>
<input name="txtCode" type="text" value="few" id="txtCode" /><a id="LinkButton1" href="javascript:__doPostBack('LinkButton1','')">search</a><br />
<span id="lblCodes"><br><a href=javascript:setcode();>few</a></span> <br />
</div>
</form>
</body>
</html>