rameshg87
04-24-2010, 06:53 AM
Hi All,
I have a javascript function which adds a label and value to a select widget in its parent window. The function is working fine in firefox and chrome without any errors or warnings. But it is not working in internet explorer. Please tell me what the issue is. Thanks in advance for your help.
function addToParent( formName, selectName, name, label ) {
var parent = window.opener;
var selectWidget = parent.document.forms[formName].elements[selectName];
if( selectWidget ) {
var length = selectWidget.length;
selectWidget[length] = new Option( name, label, false, false );
}
}
When I tried to debug, internet explorer shows an error in the following line
selectWidget[length] = new Option( name, label, false, false );
Is there anything wrong with this statement ??
I have a javascript function which adds a label and value to a select widget in its parent window. The function is working fine in firefox and chrome without any errors or warnings. But it is not working in internet explorer. Please tell me what the issue is. Thanks in advance for your help.
function addToParent( formName, selectName, name, label ) {
var parent = window.opener;
var selectWidget = parent.document.forms[formName].elements[selectName];
if( selectWidget ) {
var length = selectWidget.length;
selectWidget[length] = new Option( name, label, false, false );
}
}
When I tried to debug, internet explorer shows an error in the following line
selectWidget[length] = new Option( name, label, false, false );
Is there anything wrong with this statement ??