【发布时间】:2018-06-29 07:48:21
【问题描述】:
<form name="formName" id="formName" action="" method="post" autocomplete="off">
<input type="hidden" name="text1" id="text1" value='0' />
<input type="button" name ="submit" onClick="Submit()" value="submit">
</form>`
<script>
function Submit() //my function
{
document.getElementById("formName").submit();
}
</script>
I need some help... I have also tried `this document.formName.submit();` but still not working.
在调试时我得到了这个错误:Uncaught ReferenceError: formNameis not defined
【问题讨论】:
-
将
name="submit"更改为其他名称。
标签: javascript html form-submit