I have a form with action = post and i am validating it with after validating it I am submitting that form with:
$("#form").submit();
But it is submitting all fields nulled while I have data in those fields. How can I post those fields filled?
I have a form with action = post and i am validating it with after validating it I am submitting that form with:
$("#form").submit();
But it is submitting all fields nulled while I have data in those fields. How can I post those fields filled?
You could try with "trigger", though I doubt it'll give you a different result:
$(form).trigger("submit");
But I think the real solution, is to put the validation inside the submit method, in this way:
$("form").submit(function() {
if ($("input:first").val() == "correct") {
$("span").text("Validated...").show();
return true;
}
$("span").text("Not valid!").show().fadeOut(1000);
return false;
});
Look here to (if the problem is with ie6):