8
Answers

page should not post if condition is false

if condtion is false page should not post and it is working proper but if condition is true page should post..this is not working
 
<script>
$("#category").on('submit', function (event) {
var url = '@Url.Action("CheckCategory_Name", "CategoryAndSubCategory")';
$.getJSON(url, { Category1: Category1, Category2: Category2, Category3: Category3, Category4: Category4, Category5: Category5 }, function (data) {
debugger;
if (data.isDuplicate == true)
{
swal("The Category Name Is Already Exist");
return false;
}
});
</script>
Answers (8)