Obtain Values Of Array With Jquery November 20, 2022 Post a Comment Let's say i have this form: Field A Solution 1: Square brackets are used in jQuery selector and we should use escape characters to include the square bracket in id of control; Live Demo iterator = 0; $('#field\\['+iterator +'\\]\\[a\\]').val(); Copy Solution 2: The character "[" is not neutral in jquery selectors : $('#field[0][a]') means : " select the items which have id "field", and also have an attribute named '0', and another attribute named 'a' " You can : either change your way to give an id to your fields, like : id="field_0_a", and thus have $('#field_0_a') work correctly, or select your items by name : $('[name="field[0][a]"]') or do like Adil said Solution 3: Add a class to inputs and do thisBaca JugaWhen Is Triggered Ajax Success?Pdfkit - Custom Fonts - Fs.readfilesync Is Not A FunctionBootstrap : Uncaught Typeerror: $(...).datetimepicker Is Not A Function jQuery(document).ready(function($){ $('.inputs').each(function(index, object){ console.log($(object).val()); }); }); Copy On your code you need change here: var v = $('#field[iterator][a]').val(); Copy to: var v = $('#field\\['+iterator+'\\]\\[a\\]').val(); Copy Solution 4: The problem is that you have to escape special characters like the following: $('[id="field[' + iterator + '][b]"]').val(); or $('#field\\[' + iterator + '\\]\\[b\\]').val(); demo Share You may like these postsKnockoutjs Clear Selected Value In ComboboxRemove Space/spaces Between Two WordsSimplify Semver Version Compare LogicNavigator.geolocation Not Working Post a Comment for "Obtain Values Of Array With Jquery"