Home >Web Front-end >HTML Tutorial >How to submit when the input to be submitted in the form is type='button'? _html/css_WEB-ITnose
How to submit the form with input type="button"?
<form action="#" method="POST"><input type="button" value="这是提交的内容"><input type="submit" value="提交"></form>
By the way, there is also
<form action="#" method="POST"><input type="submit" value="提交"></form>how to submit the value of the input itself: "Submit "?
Add name attribute
2f4f4d14c1b2d1279368eee403aa8548
1a8158d41b4f592c190dd221142fe988
b5b60d0e6f89b509d88376c3e981b711
42d2a595afbd6958f502978a5a9aea02
<form action="#" method="POST" id="inputForm"><input type="button" value="这是提交的内容"><input type="submit" onclick="checksubmit()" value="提交"></form>
function checksubmit(){ $("#inputForm").submit();//jquery方式. //document.getElementById("inputForm").submit();原生js方式,未测试.}
Add the name attribute so that the background can recognize it. Or submit using ajax