title: Getting degugging error: Uncaught TypeError: Cannot read property 'value' of undefined
body: <p>I'm using the following script to populate two text fields based on the selection from another field. I have it working in a jsFiddle, but it doesn't work on the actual site. The page in question is:</p>
  
  <p><a href="http://www.ortorderdesk.com/product/prepare-for-your-closing-copy/" rel="nofollow">http://www.ortorderdesk.com/product/prepare-for-your-closing-copy/</a></p>
  
  <p>And the script is:</p>
  
  <pre><code>// JavaScript Document
  
  // Pre populated array of data
  var myData1 = new Array();
  myData1['DFW Locations...'] = 'Blah';
  myData1['Addison'] = '14295 Midway Road, Suite 100';
  myData1['Arlington'] = '1241 W. Green Oaks Blvd., Suite 101';
  myData1['Colleyville'] = '1210 Hall Johnson Road, Suite 150';
  myData1['Fire Wheel'] = '650 Beebalm Lane, Suite 260';
  myData1['Flower Mound'] = '3020 Corporate Court, Suite 400';
  myData1['Fort Worth'] = '4421 Oak Park Lane, Suite 102';
  myData1['Legacy'] = '7500 Dallas Pkwy., Suite 175';
  myData1['Mansfield'] = '1405 N. Highway 287, Suite 101';
  myData1['McDermott'] = '3915 McDermott Road, Suite 2000';
  myData1['Preston Center'] = '8201 Preston Road, Suite 450';
  var myData2 = new Array();
  myData2['DFW Locations...'] = 'Blah';
  myData2['Addison'] = 'Addison, TX 75001';
  myData2['Arlington'] = 'Arlington, TX 76013';
  myData2['Colleyville'] = 'Colleyville, TX 76034';
  myData2['Fire Wheel'] = 'Garland, TX 75040';
  myData2['Flower Mound'] = 'Flower Mound, TX 75028';
  myData2['Fort Worth'] = 'Addison, TX 75001';
  myData2['Legacy'] = 'Addison, TX 75001';
  myData2['Mansfield'] = 'Addison, TX 75001';
  myData2['McDermott'] = 'Addison, TX 75001';
  myData2['Preston Center'] = 'Addison, TX 75001';
  
  
  
  document.getElementsByClassName('cart')[1].input_1.onchange = updateText;
  
      function updateText() {
        var obj_sel = document.getElementsByClassName('cart')[1].input_1;
       document.getElementsByClassName('cart')[1].input_19.value = myData1[obj_sel.value];
           var obj_sel = document.getElementsByClassName('cart')[1].input_1;
        document.getElementsByClassName('cart')[1].input_21.value = myData2[obj_sel.value];
  
  }
  </code></pre>
  
  <p>The <code>[1]</code> was added because another item, a <code>&lt;li&gt;</code>, exists with the class 'cart'.</p>
  
  <p>When I debug and select from the dropdown, I get the error "Uncaught TypeError: Cannot read property 'value' of undefined" which I understand means that one of my references is off. However, when I look it over, all of my class, ID and name references appear to match up with the code on the page.</p>
  
  <p>Could someone please look over the page at:
  <a href="http://www.ortorderdesk.com/product/prepare-for-your-closing-copy/" rel="nofollow">http://www.ortorderdesk.com/product/prepare-for-your-closing-copy/</a></p>