Home  >  Article  >  Backend Development  >  javascript - 将submit放在form标签之外如何实现表单的提交

javascript - 将submit放在form标签之外如何实现表单的提交

WBOY
WBOYOriginal
2016-06-06 20:27:571926browse

我想把submit的按钮放在form标签之外,怎么把实现数据的提交

回复内容:

我想把submit的按钮放在form标签之外,怎么把实现数据的提交


下面的是在表单外面的...

可以考虑ajax吧

用button,再写个js事件。满足你。

//在form表单外
表单提交

不考虑兼容性的话。表单元素都加了个form属性,就算不是在form内,也会绑定的
补充:


提交按钮在form外面,但提交的时候会验证form里面的text的required,当然你把文本框放外面然后加form属性也可以
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn