js好人进,怎样利用button触发submit表单提交,javascript,ajax,htm
<formmethod=postaction='save.asp'name=formaonsubmit='returncheckform();'><inputtype="...
<form method=post action='save.asp' name=forma onsubmit='return checkform();'>
<input type="email" placeholder="名称" class="bk" name="name">
<input class="bk" type="email" name="tel" placeholder="电话">
<input name="submit" type="submit" value="提交">
</form>
最后的提交那段type="submit"改成type="button"就不能提交到表单数据里面去了,该如何实现? 展开
<input type="email" placeholder="名称" class="bk" name="name">
<input class="bk" type="email" name="tel" placeholder="电话">
<input name="submit" type="submit" value="提交">
</form>
最后的提交那段type="submit"改成type="button"就不能提交到表单数据里面去了,该如何实现? 展开
2个回答
展开全部
<input name="button" type="button" id="button" value="提交">
<script type="text/javascript">
window.onload=function(){
var oForm=document.getElementsByTagName('form')[0];
var oBtn=document.getElementById('button');
oBtn.onclick=function(){
oForm.submit();
}
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询