I have a web page that has got various admin fields in it. One of these fields is a select box. next to the select box i have an icon that will open a new window to allow the user to enter new information.
what i want to be able to do is for the relevant information from window2 to be added to the select box in window1.
this is the code that i have got in window2 at the moment. this is goign to be activated when the page is submitted and will eventually get its values from what was on the form
var objWindow = window.opener;
numElements = objWindow.document.getElementById('DriverID').length;
DriverName = "a new driver";
DriverID = 26;
objWindow.document.forms[0].DriverID.options[objWindow.document.forms[0].DriverID.length] = new Option(DriverName, DriverID, true, true);
when i execute this i either get "the server returned an exception" or the browser crashes!
Can anyone see what is wrong with this code or suggest a different way of doing this?
what i want to be able to do is for the relevant information from window2 to be added to the select box in window1.
this is the code that i have got in window2 at the moment. this is goign to be activated when the page is submitted and will eventually get its values from what was on the form
var objWindow = window.opener;
numElements = objWindow.document.getElementById('DriverID').length;
DriverName = "a new driver";
DriverID = 26;
objWindow.document.forms[0].DriverID.options[objWindow.document.forms[0].DriverID.length] = new Option(DriverName, DriverID, true, true);
when i execute this i either get "the server returned an exception" or the browser crashes!
Can anyone see what is wrong with this code or suggest a different way of doing this?