Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Dropdown list

Hi,

I am validating my drop down list

if (DcFrm.DispStateBoxST.selectedIndex == 0)
{
  errorMsg += "Select a state\n";
  if (errorField==null) errorField=FRMAcc.DispStateBoxST;
 }

How can I say if it does not exist DcFrm.DispStateBoxST print error message
Avatar of dsmile
dsmile
Flag of Viet Nam image

You need to provide more information:
1. what do you need exactly
2. how is your form constructed (html code should be ok)
3. where do you get DcFrm
ASKER CERTIFIED SOLUTION
Avatar of chaitu chaitu
chaitu chaitu
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER


I want to say if the drop down has no option to select send an error message. 

something like this but the code below is not working

if (!DcFrm.GetCity)
{
	errorMsg += "Select a city\n";
	if (errorField==null) errorField=FRMAcc.GetCity;
}
else
{
	if (DcFrm.GetCity.selectedIndex == 0)
	{
		errorMsg += "Select a city\n";
		if (errorField==null) errorField=FRMAcc.GetCity;
	}
}

Open in new window

Avatar of lulu50

ASKER

Thanks