A child window is opened from a form, with the intention of updating a select list, when a required value is not present, I only want the select list updated and not the whole form refreshed(reset) when the following code is run nothing is happening:
<script language=javascript>
function refreshlist(passedid)
{
alert(passedid);
var thebox=window.opener.document.getElementById(passedid);
alert(thebox.id)
thebox.options[thebox.options.length] = new Option('<%=idvalue & "','" & showValue %>');
alert(thebox.options.length)
window.close();
}
</script>
<div align=center><A HREF="javaScript:refreshlist('<%=selectid%>');">[Click here to close window]</A></div>
When the link is clicked, the first alert appears OK with the correct variable value showing, when viewing the source for the web page all other variables are filled as they should be.
However when the second alert box appears it is blank, when all the alert boxes are commented out the link does nothing, including not closing.
Is there a better way to update a form with out losing previously entered data? or why won't the above function work.
The more you know, the more you realise there is to know....
CCNA MCP
<script language=javascript>
function refreshlist(passedid)
{
alert(passedid);
var thebox=window.opener.document.getElementById(passedid);
alert(thebox.id)
thebox.options[thebox.options.length] = new Option('<%=idvalue & "','" & showValue %>');
alert(thebox.options.length)
window.close();
}
</script>
<div align=center><A HREF="javaScript:refreshlist('<%=selectid%>');">[Click here to close window]</A></div>
When the link is clicked, the first alert appears OK with the correct variable value showing, when viewing the source for the web page all other variables are filled as they should be.
However when the second alert box appears it is blank, when all the alert boxes are commented out the link does nothing, including not closing.
Is there a better way to update a form with out losing previously entered data? or why won't the above function work.
The more you know, the more you realise there is to know....
CCNA MCP