我在 html 按钮标签上有问题
这是我的html代码
<form name="data_kirim" action="confirm_order.php" method="POST">
..... order input field ....
<button class="back_button" onclick="window.location.href='keranjang.php'">Back</button>
<input class="next_button" type="submit" name="submit_data_kirim" value="Next"/>
</form>
如何防止按钮提交此表单,因为按钮正在使用 href 返回页面,
有人可以帮助我吗?
最佳答案
改变
type='submit'
到
type='button'
关于javascript - 防止按钮提交表单 onclick,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20754887/