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?
I had the same problem, found out that my input was without the name attribute, that is required for post data.
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):
Does your form have an id set to "form"? If not just remove the hash from your $("#form")..sorry to be cheeky but there is no code so I am guessing...
submit JQuery method don't send the form, it
Bind an event handler to the "submit" JavaScript event, or trigger that event on an element
You have to use the "standard" submit method.