using Jquery to automatically submit form

后端 未结 5 1917
粉色の甜心
粉色の甜心 2021-02-20 09:41

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

$(function(){

$(\"input[name=name]\").val(\"somename\");
$(\"input[name=email]\").val         


        
相关标签:
5条回答
  • 2021-02-20 10:17

    Try this $('#aweberform').submit();

    0 讨论(0)
  • 2021-02-20 10:19

    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

    0 讨论(0)
  • 2021-02-20 10:29

    Try this document.getElementById('formId').submit();

    0 讨论(0)
  • 2021-02-20 10:32

    Add a function in the submit. Seems to work for me.

    $('#aweberform').submit(function(){return true;});
    
    0 讨论(0)
  • 2021-02-20 10:33

    I had to remove my Submit button to get $('#myForm').submit() to work. Not sure why.

    0 讨论(0)
提交回复
热议问题