Your code seems fine, but you might be getting a value as 0 or something else instead of a blank value. Change the code to monitor that:
1. Event handler is called.
2. What is the value of batch id.
The modified code is:
function validateValues() {
alert($('#batchIDSelect').val());
if ($('#batchIDSelect').val() == '' || $('#batchIDSelect').val() == null) {
alert("Pls Select the BatchID");
return false;
}
return true
}
$("#getCountButton").click(function () {
alert("click event handler called.");
debugger;
if (!validateValues()) {
return;
}
});