2013-12-20 79 views
-2

我有這樣一對夫婦的投入:的jQuery包含選擇不工作

coleta[produtos_attributes][1387560503618][codigo] 
coleta[produtos_attributes][2315466542152][codigo] 

當我嘗試使用從文檔此代碼來選擇它們:

$("input[name*='[codigo]'") 

返回給我一個空陣列。它沒有找到它們。 任何人都可以幫忙嗎?

編輯:發佈HTML

<input id="coleta_produtos_attributes_0_codigo" class="input_text ui-corner-all" type="text" size="30" name="coleta[produtos_attributes][0][codigo]"> 
<input id="coleta_produtos_attributes_1387560503618_codigo" type="text" size="30" name="coleta[produtos_attributes][1387560503618][codigo]"> 
+3

什麼是你的標記是什麼樣子? –

+0

後的html代碼也 –

+0

您作爲類型化的選擇是無效的,你有沒有正確複製呢? –

回答

4

你缺少一個括號

$("input[name*='[codigo]']") 
+0

感謝兄弟..整天:( – renatojf

+0

這些事情發生;) – joelmdev