title: How to pass Multiple input array element values having same name like ex: sikll[] via Ajax POST
body: <p>I have a form with 4 skill inputs having html like:</p>
  
  <pre><code>&lt;input type="text"  id="skill1" name="skill[]" value=""&gt;
  &lt;input type="text"  id="skill2" name="skill[]" value=""&gt;
  &lt;input type="text"  id="skill3" name="skill[]" value=""&gt;
  &lt;input type="text"  id="skill4" name="skill[]" value=""&gt;
  </code></pre>
  
  <p>I need to get this in controller like:</p>
  
  <p>Is there any way to get skill names passed to server without serialize as i have to append a limit attribute to my search_param which is an object. Basically i want all post data in search_param.data and my limit in search_param.limit</p>
  
  <p>skill -> array('0'=>'php','1'=>java','2'=>'html') (basically as array in controller)</p>
  
  <p>Previously i submitted data as form submit. Now i am making this to Ajax. I tried serialize() to transfer data to server controller via Ajax. But issue is that i am using a paginate function which accept limit as parameter(ex: param.limit, param is an Object).(pls chk below code) I need to pass both data and limit to ajax paginate function.</p>
  
  <p>I need to pass both post data and limit to paginate function.</p>
  
  <p>Below is the code:</p>
  
  <pre><code>    function getUsers() {
          var search_param = {'data':jQuery('#candidateForm').serialize()};
          jQuery.ajax({
              type: "POST",
              dataType:'JSON',
              url: jQuery('#site').val() + "search/ajax_search",
              data: search_param,
              cache: false,
              success: function(data) {
                  if (data) {
                  //something
  }else{
                      //else something
                  }
                  search_param.limit = 14; //this is desired way but as serialized it wont work
                  paginate_4a(jQuery('#site').val()+'search/ajax_search', 'srchResultCnt', search_param, {'fn':'fn_name', 'index':0});
  
              }
  
          });
      }
  </code></pre>
  
  <p>TRIED THIS BUT FAILED:</p>
  
  <pre><code>var skill = jQuery('input[name="skill[]"]').map(function(){return jQuery(this).val();});
      var skill_hid = jQuery('input[name="skill_hid[]"]').map(function(){return jQuery(this).val();});
      var experience = jQuery('input[name="experience[]"]').map(function(){return jQuery(this).val();});
      var search_param = {
          'skill':skill,
          'skill_hid':skill_hid,
          'experience':experience
      };
  </code></pre>
  
  <p>Throwing Uncaught TypeError: Illegal invocation 
  Any help is appreciated.</p>
  
  <p>SOLUTION:</p>
  
  <p>use get() at last and now getting array in server side...thanks to Nisam....</p>
  
  <p>$('input[name="skill[]"]').map(function(){return $(this).val();}).get();</p>