I am trying to reset a select box in a parent window without refreshing the whole page, the child window is used to enter a new value for a drop down box.
The function that should work is:
function refreshlist(passedid)
{
alert(passedid);
var thebox=window.opener.getElementById(passedid);
alert(thebox.id)
thebox.options[thebox.options.length] = new Option('<%=idvalue & "','" & showValue %>');
alert(thebox.options.length)
window.close();
}
The alert boxes are for debugging.
The function is executed using <a href etc> from a child window that is opened from the parent.
The first alert box appears Ok with the correct value, then nothing happens.
Alert(window.opener.value), returns 'unspecified'
Alert(window.opener.location), returns the URL for the child window
Alert(document.parentWindow.location), returns the URL of the parent window
The more you know, the more you realise there is to know....
CCNA MCP
The function that should work is:
function refreshlist(passedid)
{
alert(passedid);
var thebox=window.opener.getElementById(passedid);
alert(thebox.id)
thebox.options[thebox.options.length] = new Option('<%=idvalue & "','" & showValue %>');
alert(thebox.options.length)
window.close();
}
The alert boxes are for debugging.
The function is executed using <a href etc> from a child window that is opened from the parent.
The first alert box appears Ok with the correct value, then nothing happens.
Alert(window.opener.value), returns 'unspecified'
Alert(window.opener.location), returns the URL for the child window
Alert(document.parentWindow.location), returns the URL of the parent window
The more you know, the more you realise there is to know....
CCNA MCP