Hi ,
How to restrict form submit on jquery
On submit if dropdown has value is "1" then it will validate all the fields and will pass values to my controller method - Employee master
else if dropdown value is 2 then also it should validate empty fields BUT instead of going to controller it should show any alert.
NO FURTHER MOVEMENT TO CONTROLLER. Is it possible. Please help
@using (Ajax.BeginForm("EmployeeMaster", "Home", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "divEmp" }))
$(".next").on('click', function () {
if ($("#ddlstate").val() == 2) {
if (("#form").valid()) {
alert("hi");
}
else {
//nothing
}
}
});