我試圖只改變的值當前字段後面的下一個選擇框。只選擇下一個選擇框(jQuery)
該表格是一長串具有相同類的字段的行。在「第1行」中「數量」字段的焦點上,我想將「類型」選擇框更改爲同一行中的「框」。我嘗試的所有代碼都會使整個頁面上的所有「類型」選擇框發生更改。我只想要最接近數量字段的最直接的一個。
UOM字段是我嘗試在用戶關注數量時更改的字段。
謝謝!
<tr class="draggable odd">
<td class="content-multigroup-cell-field-part-num">
<div id="edit-group-order-0-field-part-num-value-wrapper" class="form-item">
<label for="edit-group-order-0-field-part-num-value">J&B No.:
</label>
<input type="text" class="form-text text idleField" value="" size="10" id="edit-group-order-0-field-part-num-value" name="group_order[0][field_part_num][value]" pattern="[0-9]*">
</div>
</td>
<td class="content-multigroup-cell-field-quantity">
<div id="edit-group-order-0-field-quantity-value-wrapper" class="form-item">
<label for="edit-group-order-0-field-quantity-value">Quantity:
</label>
<input type="text" class="form-text text idleField" value="" size="5" id="edit-group-order-0-field-quantity-value" name="group_order[0][field_quantity][value]" pattern="[0-9]*">
</div>
</td>
<td class="content-multigroup-cell-field-quantity-type">
<div id="edit-group-order-0-field-quantity-type-value-wrapper" class="form-item">
<label for="edit-group-order-0-field-quantity-type-value">UOM:
</label>
<select id="edit-group-order-0-field-quantity-type-value" class="form-select" name="group_order[0][field_quantity_type][value]">
<option selected="selected" value="">- None -
</option>
<option value="Box(es)">Box(es)
</option>
<option value="Case(s)">Case(s)
</option>
<option value="Each">Each
</option>
<option value="Feet">Feet
</option>
</select>
</div>
</td>
Ĵ&乙編號: 數量: UOM: - 無 - 盒(ES) 情況下() 每個 腳
你能發表你正在使用的代碼/標記嗎? – 2010-07-17 18:17:42
這將有助於查看實際的html以查看DOM層次結構。 – 2010-07-17 18:29:56
我已經用代碼更新了原文。對於那個很抱歉! – Ryan 2010-07-17 19:48:03