It is because calling $("#submit").submit();
again triggers the submit event which will again invoke the submit handler thus creating an infinite recursive loop... call the dom elements submit method instead like this.submit()
or use the preventDefault() only if the value is invalid else allow the default action to continue
$(document).ready(function () {
$("#submit").submit(function (e) {
var check = $("#check").val();
if (check != 1) {
e.preventDefault();
alert("input-hidden value is wrong")
}
});
});