【发布时间】:2012-08-30 11:59:36
【问题描述】:
我有一个包含很多表格行的表格<tr>。
每个<tr> 作为button 和link。
这是我的一些代码
<form name="mycart" id="mycart" action="library/cartactivity.php?action=update" method="post">
<table cellspacing="0">
<tr id="cart-list" onClick="document.location.href='index.php'">
<td><button onclick="location.href='library/stockactivity.php';">Remove</button></td>
</tr>
</table>
<input type="submit" value="submit"/>
</form>
我的问题是当我点击<button> 时它会加载<input type="submit"> 链接
但是,我将代码更改为
<form name="mycart" id="mycart" action="library/cartactivity.php?action=update" method="post">
<table cellspacing="0">
<tr id="cart-list" onClick="document.location.href='index.php'">
<td><input type="button" onclick="location.href='library/stockactivity.php';" value="Remove" /></td>
</tr>
</table>
<input type="submit" value="submit"/>
</form>
(我把<button>改成<input type="button">)
我的问题是当我点击<input type="button"> 时,它会加载<tr> 链接
有什么解决办法吗?
【问题讨论】: