在同一页面上两个表单提交后台收不到前端提交的数据
一个页面两个表单,表单建立出来之后onclick="dr_ajax_submit和<input name="csrf_test_name" type="hidden" value="*****">都一样导致能提交,但是后台接收不到数据,应该怎么办?
一个页面两个表单,表单建立出来之后onclick="dr_ajax_submit和<input name="csrf_test_name" type="hidden" value="*****">都一样导致能提交,但是后台接收不到数据,应该怎么办?
<form method="post" name="contactus" id="contactus">
<button type="button" onclick="dr_ajax_submit('域名?s=form&c=contactus&m=post', 'myform', '2000', '域名?s=form&c=contactus&m=post')" ">同一个页面上面,两个表单都是用的button。现在这样写都可以提交,但是在后台 name="contactus"这个表单拿不到数据。如果把上面的表单注释了,就可以拿到数据。
<form method="post" name="sgyefrom" id="sgyefrom">
<button type="button" onclick="dr_ajax_submit('域名?s=form&c=sgyefrom&m=post', 'sgyefrom', '2000', '域名?s=form&c=sgyefrom&m=post')" ">
<form method="post" name="contactus" id="contactus">
<button type="button" onclick="dr_ajax_submit('域名?s=form&c=contactus&m=post', 'contactus', '2000', '域名?s=form&c=contactus&m=post')" ">