title: Express dynamic dropdown menu
body: <p>This question has been asked before but not fully resolved. </p>
  
  <p>So I have one dropdown menu and depending on user's selection a second dropdown menu will populate with specific choices. </p>
  
  <p>Javascript</p>
  
  <pre><code>  router.get('/', function(req, res, next) {
    res.render('index', {
            title: 'Design your one line.',
            moduleType: moduleType,
            moduleManufacturer: moduleManufacturer,
            modTableTitle: modTableTitle,
        }
    );
  });
  
  var modTableTitle = "Module Specification";
  
  var moduleManufacturer = [];
  var newArray = [];
      for (var x in moduleType.specs) {
          newArray[x] = moduleType.specs[x].Manufacturer;
          if (newArray[x] != newArray[x-1]) {
              moduleManufacturer.push(newArray[x]);
          }
  }
  </code></pre>
  
  <p>EJS</p>
  
  <pre><code>            &lt;/div&gt;
              &lt;select class="form-control" name="selectModuleManufacturer"&gt;
                  &lt;option selected disabled&gt;Select Module Manufacturer&lt;/option&gt;
                  &lt;% for (var x in moduleManufacturer) { %&gt;
                  &lt;option&gt;&lt;%= moduleManufacturer[x]; %&gt;&lt;/option&gt;
                  &lt;% } %&gt;
              &lt;/select&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>The second dropdown contains specs of the manufacturer selected and it's all part of a json object, so can someone help me write the second part? Appreciate it.</p>