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 nullled while i have data in those fields.... how can i post those fields filled..
A:
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...
Michal
2010-10-13 12:23:04
A:
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.
MatTheCat
2010-10-13 12:29:16
+1
A:
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):
http://stackoverflow.com/questions/445850/jquery-form-submit-is-not-working-in-ie6
netadictos
2010-10-14 06:58:47