title: How to make dynamically changing drop-down menu's in NetSuite
body: <p>Suppose there are two drop down menu's in a page and I want to change the second drop-down menu based on the selection of the first one.</p>
  <h3>For Example.</h3>
  <p>The first drop-down menu has a list of record types. If I select the <code>customer</code> record type, the second drop-down menu should automatically change to a list of customers. Same with <code>script deployments</code> etc.</p>
  <p>Not only the drop down menu's but also any dynamic action in a suitelet page.</p>
  <h3>What I've tried</h3>
  <p>I've created a suitelet with a drop-down menu. When the form is submitted the script takes the value and populates the menu.</p>
  <pre><code>var start = function(request, response) {
      if(request.getMethod() == 'GET') {
          var form1 = nlapiCreateForm('New Form 1');
          var select1 = form1.addField('custpage_select1', 'select', 'Select A record Type', '-123');
          form1.addSubmitButton('submit');
          response.writePage(form1);
      }
      else {
          var id = request.getParameter('custpage_select1');
          var form2 = nlapiCreateForm('New Form 2');
          var select2 = form2.addField('custpage_select2', 'select', 'Select A record Value', id);
          response.writePage(form2);
      }
  }
  </code></pre>
  <p>What I need is this whole thing in a single form. Something like,</p>
  <pre><code>var start = function(request, response)  {
      var form1 = nlapiCreateForm('New Form 1');
      var select1 = form1.addField('custpage_select1', 'select', 'Select A record Type', '-123');
      var select2 = form1.addField('custpage_select2', 'select', 'Select A record Type', XXXXX);//the source of the 1st select field
      form1.addSubmitButton('submit');
      response.writePage(form1);
  }
  </code></pre>