[問題] javascript讀取陣列物件的問題
在下有一個問題
我在網頁上有許多個相同名稱的物件
例如:
1<input type="text" name="author_name[]" size="10">
2<input type="text" name="author_name[]" size="10">
3<input type="text" name="author_name[]" size="10">
4<input type="text" name="author_name[]" size="10">
5<input type="text" name="author_name[]" size="10">
6<input type="text" name="author_name[]" size="10">
7<input type="text" name="author_name[]" size="10">
8<input type="text" name="author_name[]" size="10">
9<input type="text" name="author_name[]" size="10">
我後面會將資料用PHP存入
這個我會
但是我想要驗證他有沒有輸入
我用javascript
沒辦法讀取
不管用author_name它顯示undefined(沒javascript錯誤)
還是用author_name[0]它也顯示undefined(javascript的錯誤)
根本不行讀到裡面的值
請問有什麼方法可以讀到裡面的值
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.50.57.247
→
08/19 11:51, , 1F
08/19 11:51, 1F
推
08/19 13:31, , 2F
08/19 13:31, 2F
→
08/19 14:03, , 3F
08/19 14:03, 3F
→
08/19 14:03, , 4F
08/19 14:03, 4F
→
08/19 14:04, , 5F
08/19 14:04, 5F
推
08/19 20:45, , 6F
08/19 20:45, 6F
→
08/19 20:46, , 7F
08/19 20:46, 7F
→
08/19 20:46, , 8F
08/19 20:46, 8F
→
08/19 22:44, , 9F
08/19 22:44, 9F
→
08/20 11:39, , 10F
08/20 11:39, 10F
→
08/20 11:40, , 11F
08/20 11:40, 11F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章