JS 可以通过 document.testform.submit() 提交 name/vale 对吗? ?
或者是否必须通过 html 标签提交,例如
<INPUT TYPE="text" NAME="inputbox1" VALUE="This is such a great form!" SIZE=50><P>
通常,您在表单中包含 ,并在提交之前在事件处理程序中设置所需的值。
<form method="post" action="thing" id="sandwich"><fieldset>
<input type="text" name="inputbox1" value="This is such a great form!" />
<input type="hidden" name="jsremark" />
</fieldset></form>
<script type="text/javascript">
document.getElementById('sandwich').onsubmit= function() {
this.elements.jsremark.value= 'Secretly it aint that great';
return true;
}
</script>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)