Dr.Ajay Kashyap

Dr.Ajay Kashyap

  • NA
  • 521
  • 285.1k

page should not post if condition is false

Feb 9 2017 6:26 AM
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)