Try the code below. Added e.preventDefault () . This removes the default action for the form.
$(document).ready(function () { $("form").submit(function (e) { $.ajax({ url: '@Url.Action("HasJobInProgress", "ClientChoices")/', data: { id: '@Model.ClientId' }, success: function (data) { showMsg(data, e); }, cache: false }); e.preventDefault(); }); });
In addition, you mentioned that you want the form not to be submitted in accordance with the prerequisite for verification, but I do not see the code verification here?
Here is an example of some additional validation
$(document).ready(function () { $("form").submit(function (e) { if(!$('#inputID').val()){ e.preventDefault();
Downpour046 Apr 10 2018-12-12T00: 00Z
source share