i need to validate a dropdownlist (ddlState) in a c# asp.net webform. in
other words, i need to make sure that the user selects an item in the
dropdownlist. it contains the items:
Items Index
(Select a state) 0
Arizona 1
California 2
.....
my code that is not working:
<script type="text/javascript">
function Validate(){
if (document.Form1.ddlState.value == "(Select a state)")
{
alert("Please select a state.");
}
}
</script>