i try to build an autosubmit with the Jquery Form Plugin.
for example
$("#my_form").change(function(){
document.my_up_form.submit();
});
The file upload and everything works but i get a page reload. I dont understand that.
When use the normal submit button it works (no page reload).
Can somebody tell me what the different between a normal <input type="submit" value="go" /> and the document.myform.submit(); is?
Thanks in advance!
Peter
UPDATE
Hi Lee,
thank you very much for the fast answer.
This document.my_up_form.ajaxSubmit(); will not work but this $('#my_up_form').ajaxSubmit(); do the job.
But know i have a new the problem .. i dont get a answer.
Whats wrong know?
$('#my_up_form').ajaxForm({dataType: 'json', success: processJson});
function processJson(data)
{
if(data['success'] == true)
{
alert('true');
}
else
{
alert('false');
}
}
The jquery
ajaxFormmodifies the submit button so that it callsajaxSubmit()instead of the browser’s normal action. When you callsubmit()you’re invoking the browser’s normal action. you should callajaxSubmit()instead.Check the “API” tab on the same documentation page you linked.