我做一個上下文菜單,它幾乎完成了,就離開了這個問題對我來說,但我不知道這樣做:jQuery的得到不同的輸入隱藏的價值鏈接
從輸入隱藏單條鏈路得到不同的值,因爲我想將它傳遞到控制器動作
<table>
<tr>
<td class="element">im here
<input type="hidden" id="theid" name="theid" value="1"/>
</td>
</tr>
<tr>
<td class="element">im there
<input type="hidden" id="theid" name="theid" value="2"/>
</td>
</tr>
<tr>
<td class="element">im where
<input type="hidden" id="theid" name="theid" value="3"/>
</td>
</tr>
</table>
<div type="context" class="menu"> // link
<a href="?r=TotheLink/HAHA&theid="><label class="menuitem">Cancel this app</label></a>
</div>
我想要的值傳遞給theid
,例如右鍵點擊即時在這裏鏈接應該得到隱藏值= 1等,任何建議要做到這一點?謝謝
首先,你的HTML是你使用的ID重複的無效'theid' – 2014-12-04 04:31:42
@Kartikeya因爲我必須通過'theid '所以所有的id應該是相同的 – TheSmile 2014-12-04 04:32:37
你錯誤地認爲我的朋友你正在使用三個隱藏的字段,它們是相同的id,這是絕對錯誤的。** – 2014-12-04 04:34:04