form表单提交

方法一:submit提交

<form id="form1" action="huahua.php" method="post" onsubmit="return checkForm()">
<input type="hidden" name="op" value="add">
<input type="submit" id="sub" value="确定">

方法二:点击按钮,操作表单并提交

<input type="button" onclick=""addMovie()>
<form id="form1" action="huahua.php" method="post">
</form>
<script>
function addMovie(){
  $("#op").val('add_films_show');
  $("#form1").submit();
}
</script>

方法三:点击按钮,操作表单并提交

<input id="btn" type="button">
<form id="form1" action="huahua.php" method="post">
<input type="submit" id="sub" value="确定">
</form> 
<script>
btn.onclick = function() {
    $("#op").val('add_films_show');
    $("#form1").attr("onsubmit","true");
    sub.click();
}
</script>


原文地址:https://www.cnblogs.com/xiaobiaomei/p/8557451.html