Select Multidimensional Arrays From Form With Jquery
I tried to select a multidimensional form item with JQuery. But when I try to alert its value I just get an undefined. This is my form:
Solution 1:
Use $('select[name="item[1][name]"]');
Or alternatively, $(':input[name="item[1][name]"]');
input
will only select the elements with input
tag, so for your select you have to use the select
tag.
Alternatively jquery provides the special :input
selector that returns any form element (input texts, selects, checkboxes, textarea,etc), so you can use that too.
Solution 2:
var item1n = $('input[name="item[1][name]"]');
you've the wrong selector here. Try this
var item1n = $('select[name="item[1][name]"]');
Post a Comment for "Select Multidimensional Arrays From Form With Jquery"