add option on another page

A

Anonymous

Guest
Hi does anyone know if it's forbidden to add an option in a list on another page? I think it is but maybe I am doing something wrong:

Code:
function setOption(ip,status) {
  var elemID = 'ip_usr';
  var length = window.opener.document.forms.form1.ip_usr.length;
  var optionName = new Option(ip, status);
  window.opener.document.all(elemID).options[length] = optionName;
  window.opener.document.forms.form1.ip_usr.options[length] = optionName;    
  window.opener.document.getElementById(elemID).options[length] = optionName;    
  window.opener.document.layers[elemID].options[length] = optionName;
}

neither of the last lines work...they all give me the error:
The server threw an exception

so, could anyone confirm me that it is forbidden to add an option on another page? :)
 
hmmm found the answer. It's just not supported yet:


Code:
Note: This works in Netscape 4.x and 6.x but NOT IE 5.x
IE 5.x reports:
   'The server threw an exception'
Script debugger points to the line that the option., i.e.,
   sel.option[sel.options.length] = opt;
Further details:
   'An exception of type "Microsoft JScript runtime error: Object 
    doesn't support this property or method" was not handled.'
 
Back
Top