check if selection is made

  • Thread starter Thread starter Andy G
  • Start date Start date
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
 
add a custom validator, then check the SelectedItem.Value or if you know the
Index use that.
 
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
 
Back
Top