S
soup_or_power
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.length" ) == 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.length" ) == 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.length" ) == 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.length" ) == null &&
eval("objs.type") == 'single-selection' ) objs = new Array( objs );
if ( objs == null ) objs = new Array();
return objs;
}