title: How to pass dynamic amount of data in jQuery ajax post
body: <pre><code>$.ajax({
    url: '&lt;?=parseLink("modules/Contacts/output/output.php")?&gt;',
    data: { 
      $('.contacts-block-input-text').each(function(){
        id: $(this).attr('id'),
        value: $(this).val()
      })
    },
    type: 'post',
    success: function(result){
      $('.resultMessage').text(result)
    }
  })
  </code></pre>
  
  <p>So there will be dynamic amount of input fields and I need to gather all the <code>contacts-block-input-text</code> values and pass them in the <code>data</code> field somehow. How could I do this? The given example doesn't work.</p>