jQuery提交form表单

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jQuery提交form表单相关的知识,希望对你有一定的参考价值。

<form id="search_form" name="search_form" method="post"> 
      <input type="text" name="username" /> 
</form>
<script type="text/javascript">
	$(function() {
		$(‘#btn‘).bind(‘click‘, function() {
			document.search_form.action = ‘admin/queryAll.do?pid=‘ + pid;  //定义 action,并传參 
			$(‘#search_form‘).submit();
		});
	})
</script>

作者:itmyhome

以上是关于jQuery提交form表单的主要内容,如果未能解决你的问题,请参考以下文章

jQuery ajax提交form表单

jQuery ajax表单提交

jquery AJAX将数据放在表单

SpringBoot中表单提交报错“Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported“(代码片段

使用JQuery的.ajax()提交表单后当前页面表单内容被清空,请问如何保留数据?

怎么使用jquery提交表单