Submit name value pair from javascript?

后端 未结 5 1987
鱼传尺愫
鱼传尺愫 2021-01-23 23:30

Can JS submit name/vale pairs through a document.testform.submit(); ? or does it have to be submitted through the html tags, for example



        
5条回答
  •  爱一瞬间的悲伤
    2021-01-23 23:54

    With jquery it is very simple:

    $("#formid").bind("submit", function(){
     var str = $("#formid").serialize();
     $.post("url?"+str);
     return false;
    }
    

提交回复
热议问题