Can someone please explain why getObjects2 works and getObjects1 fails?
Thank you.
function getObjects1 ( obj_name) {
var objs = eval( "document.main_ form.elements[obj_name]" );
if ( objs != null && eval( "objs.lengt h" ) == null ) objs = new
Array( objs );
if ( objs == null ) objs = new Array();
return objs;
}
function getObjects2 ( obj_name ) {
var objs = eval( "document.main_ form.elements[obj_name]" );
if ( objs != null && eval( "objs.lengt h" ) == null &&
eval("objs.type ") == 'single-selection' ) objs = new Array( objs );
if ( objs == null ) objs = new Array();
return objs;
}
Thank you.
function getObjects1 ( obj_name) {
var objs = eval( "document.main_ form.elements[obj_name]" );
if ( objs != null && eval( "objs.lengt h" ) == null ) objs = new
Array( objs );
if ( objs == null ) objs = new Array();
return objs;
}
function getObjects2 ( obj_name ) {
var objs = eval( "document.main_ form.elements[obj_name]" );
if ( objs != null && eval( "objs.lengt h" ) == null &&
eval("objs.type ") == 'single-selection' ) objs = new Array( objs );
if ( objs == null ) objs = new Array();
return objs;
}
Comment