...

View Full Version : selPackName1.0 is null or not an object



blindbull
08-23-2002, 12:42 PM
I want to check to determine if my select list box is empty and return out the funciton if so. What happens is that when I execute the following code below I get:

document.main_form.selPackName1.0 is null or not an object. Does anyone know of a way round this?

if (document.main_form.selPackName1[0] == null)
{
return
}

martin_narg
08-23-2002, 12:53 PM
The problem exists because of the decimal point/full stop in the select name. If you change that like this:
from:
selPackName1.0
to:
selPackName1_0

then change all the references to it, then your problem should be resolved

hope this helps

m_n

blindbull
08-23-2002, 02:35 PM
The decimal point exists only in the message that is displayed by the javascript error alert box, it does not exist in the name of the select box.

blindbull
08-23-2002, 03:53 PM
I've fixed this now it needed:

if (typeof(document.main_form.selPackName2) == 'undefined')
{
return;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum