SAIRAJ MORE

SAIRAJ MORE

  • NA
  • 12
  • 2.6k

dropdownlist validation javascript

Nov 2 2016 6:37 AM
im use this validation to all dropdown list but javascript validation not work so please help me 
 
 
 
function ValidateDropDownList() {
if (ddlst.value.length == State) {
alert("Please Select States.");
ddlst.focus();
return false;
}
if (document.getElementById("<%=ddlmo.SelectedIndex %>").value == "0")
{
alert("Please Select Month.");
document.getElementById("<%=ddlmo.SelectedIndex %>").focus();
return false;
}
if (ddlye.value.length >= 0) {
alert("Please Select Year.");
ddlye.focus();
return false;
}
if (ddltr1.value.length >= 0) {
alert("Please Select Tax Revenue.");
ddltr1focus();
return false;
}
if (ddlntr1.value.length >= 0) {
alert("Please Select Non-Tax Revenue.");
ddlmo.focus();
return false;
}
if (txtncs.value.length <= 0) {
alert("Please Select Net Contribution To State.");
txtncs.focus();
return false;
}
if (isNaN(txtncs.value)) {
alert("Net Contribution To State should be numeric!");
txtncs.focus();
return false;
}
}
</script>

Answers (1)