当我发布表单时,提交表单我得不能调用方法“提交”null 但我不知道为什么它不会发布。我用jquery设置了idstatus。但变量不会以某种方式发布。
<form name="myform" id="myform" action="<?php echo base_url() ?>/agenda.php/index/" method="post">
<input type="text" name="id" id="idstatus" class="text ui-widget-content ui-corner-all">
<input type="submit" onclick="document.getElementById('myform').submit();" value="See more" />
</form>
答案 0 :(得分:4)
<form name="myform" id="myform" action="<?php echo base_url() ?>/agenda.php/index/" method="post">
<input type="text" name="id" id="idstatus" class="text ui-widget-content ui-corner-all">
<input type="submit" value="See more" />
</form>
答案 1 :(得分:0)
<!DOCTYPE html>
<html>
<body>
<p>Enter some text in the fields below, then press the "Submit form" button to submit the form.</p>
<form id="myForm" action="<?php echo base_url() ?>/agenda.php/index/" method="post">
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br><br>
<input type="button" onclick="myFunction()" value="Submit form">
</form>
<script>
function myFunction()
{
document.getElementById("myForm").submit();
}
</script>
</body>
</html>
制作一个单独的功能,它会起作用。