我有多個textboxes
和buttons
一個form
。我想用一些按鈕來清除textbox
。但是,當我點擊按鈕Clear text
表格發佈。在<form>的所有按鈕都張貼
有人知道我該如何解決這個問題嗎?
這裏是我的HTML:
<form name="reaction" method="post" action="./send.php">
<input type="text" name="firstname">
<button class="btn btn-default" onclick="ClearText1();">Clear text</button><br />
<input type="text" name="lastname">
<button class="btn btn-default" onclick="ClearText2();">Clear text</button><br />
<button class="btn btn-block btn-success">Send</button>
</form>
使用'<按鈕類型=「提交」'用於其他按鈕 – XYZ
@XYZ那是溶液提交按鈕和'<按鈕類型=「按鈕」'。謝謝 – John