I am using client side validation on Button click.
I want data get filled in all controls, then data get insert into database. But right now it ignoring validation.
<script type="text/javascript">
$(function () {
$(".js-example-placeholder-single").select2({
placeholder: "Select",
allowClear: true
});
});
$(document).ready(function () {
$("[id$=btn_Gen]").click(function () {
if ($("[id$=lbdispatchID]").html() == '')
{
//Selected option from dropdownlist
alert("Please Select Dispatch.");
}
else if ($("[id$=DDLcus]").val() == '0')
{
//Not selected so alert user to select any option
alert("Please Select Customer.");
}
else if ($("[id$=ddlcurrency]").val() == '0')
{
//Not selected so alert user to select any option
alert("Please Select Currency.");
}
});
});
</script>