Rob Chuah Rob Chuah - 1 month ago 5
jQuery Question

using Jquery to automatically submit form

I am trying to submit a form by using jquery automatically after page load

$(function(){

$("input[name=name]").val("somename");
$("input[name=email]").val("323@ds.com");
$('#aweberform').submit();

});


Both the name/email value can be seen to get populated on the form. But the submit event wont triggered.

Any one here that can shed any lights ?

thanks !

Answer

ok i found out the problem

apparently the submit input cannot have the name submit

<input type="submit" name="submit" value="click to submit!">

changed to

<input type="submit" name="someothername" value="click to submit!">

and that got the problem fixed