title: Multiple forms on one page, using ajax to post data, specify which input fields from the selected form
body: <p>I have a page that dynamically creates multiple forms and js code (20+). When the user selects an item from a select dropdown, (change trigger) it posts data to another script via ajax. </p>
  
  <p>Form names are like: form1, form2, form3, etc.
      </p>
  
  <p>Is there a way to specify which field input data to pass based on which select was changed?</p>
  
  <p>For example, with: adId: $('input[name$="ad_id"]').val()
  Need to specify which form to select from to obtain the desired data.</p>
  
  <p>If changeCat2 select changed, pass the ad_id value from that specific form (form2). </p>
  
  <p></p>
  
  <p>EDIT - More code: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;  
              $(document).ready(function() {
                  $('select.changeCat2').change(function(){
                  $.ajax({
                  type: 'POST',
                  url: 'cat_update.php',
                  data: {selectFieldValue: $('changeCat').val(), mlsId: $('input[name$="mls_id"]').val(), adId: $('input[name$="ad_id"]').val(), imageId: $('input[name$="image_id"]').val(), photoUrl: $('input[name$="photo_url"]').val()},
                  dataType: 'html'
                       });
                  });
              });
          &lt;/script&gt;
  
  &lt;form method="post" action="" name="form2"&gt;
  &lt;input type="hidden" name="mls_id" value="W7631557"&gt;
  &lt;input type="hidden" name="ad_id" value="107"&gt;
          &lt;select name="changeCat2"&gt;
              &lt;option value="Living Room"&gt;Living Room&lt;/option&gt;
              &lt;option value="Dining Room"&gt;Dining Room&lt;/option&gt;
              &lt;option value="Family Room"&gt;Family Room&lt;/option&gt;
              &lt;option value="Den/Office"&gt;Den/Office&lt;/option&gt;
              &lt;option value="Kitchen"&gt;Kitchen&lt;/option&gt;
              &lt;option value="Exterior"&gt;Exterior&lt;/option&gt;
              &lt;option value="Bedrooms"&gt;Bedrooms&lt;/option&gt;
              &lt;option value="Bathrooms"&gt;Bathrooms&lt;/option&gt;
              &lt;option value="Pool/Patio"&gt;Pool/Patio&lt;/option&gt;
              &lt;option value="Great Room"&gt;Great Room&lt;/option&gt;
              &lt;option value="Balcony/Porch/Lanai"&gt;Balcony/Porch/Lanai&lt;/option&gt;
          &lt;/select&gt;
          &lt;input type="hidden" name="image_id" value="2"&gt;
          &lt;input type="hidden" name="photo_url" value="http://myimages/"&gt;
          &lt;/form&gt;
  </code></pre>