隐藏字段,如 -
<input type ="hidden" name="details[]" id="details[]" value="1"/>
<input type ="hidden" name="details[]" id="details[]" value="2"/>
<input type ="hidden" name="details[]" id="details[]" value="3"/>
答案 0 :(得分:1)
您是否使用jquery
通过id获取数组隐藏字段值<input type="hidden" name ="testdata[]" value="" id="testdata" />
<script> $(document).ready(function(){var singleValues = $( "#testdata" ).val(); alert(singleValues);});</script>
答案 1 :(得分:0)
尝试.map()
var values = $('input[name="details[]"]').map(function(){
return this.value
}).get();