title: select input within a div by name
body: <p>I need to update the value of some input fields of a form, using values from a second (dynamically generated) div.</p>
  
  <p>Here’s the code</p>
  
  <pre><code>$("#second_update_form_data :input").each(function(index) {
  
  //find all input fields in the second div
                  var FieldName = $(this).attr("name");
                  var FieldValue = $(this).val();
  
    //try to get the corresponding field from the original form to change it
                  var Selector = "#TT_CartForm__form input[name=" + FieldName + "]";
                  var OriginalFiled = $(Selector);
  </code></pre>
  
  <p>This does not work, but I’m not sure why. I could add an id to the original input fields and use that to select them, but I’d prefer to understand what’s wrong and use the correct selector.</p>
  
  <p>Thanks in advance,
  kind regards  </p>
  
  <p>EDIT:
  I’m sorry, I realize I didn’t specified which part doesn’t work.
  It is the last line, when I try to select using Selector, so it’s this last one that seems to be wrong</p>