Hi,
For multiple you can
var e = document.forms[0].SELECTNAME;
var b = 0;
for(i=0;i<e.length;i++)
{
if(e.options[i].selected) b++;
}
if(!b) alert("Select something");
First option a no go
if(e.selectedIndex < 1 ) alert("Select something");
More info
http://msdn.microsoft.com/library/de...ence_entry.asp
--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/ http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground:
http://213.190.104.211/ ( IE 5.5+ only )
No matter where you go there you are
==============================
"Simon" <sh856531@microsofts_free_email_service.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi
Does anyone know how I can be sure that a listbox has a value in it
without
doing a post back?
If I attach a required field validator it will only allow the page to
submit
if I actually highlight one of the items in the listbox to validate.
I'm really hoping that this can be done somehow using the required field
validator. I've looked at the custom validator control but that looks like
way to much hassle especially seeing as I don't know javascript
Thanks to anyone who can help
Simon