check if selection is made

A

Andy G

I want too validate a DropDownList box. I need to make sure the user
selects one of the choices in the box except for the item with the ID of x
(the number one in this case). What is the best way to check this?

Thanks
Andy
 
C

Curt_C [MVP]

add a custom validator, then check the SelectedItem.Value or if you know the
Index use that.
 
A

Andy G

I have little to no experience in script(client side) coding. This is what
I have so far...

<script language="javascript">
function ValidQuestion()
{
if (cmbQuestion.SelectedItem.Value=1)
{
return false;
}else
return true;
}
</script>

If the value of the selected item in the drop down list is 1 will this
script fire the error of my validator(assuming I have everything else set
correctly)?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top