title: Linking PHP into Mootools on select
body: <p>How would I fill in the boxes of my form if I select one of the values from the dropdown menu (The dropdown is got from the DB)  Somehow in my javascript I need to connect to functions as there is to different tables involved with the form fields.</p>
  
  <p><strong>Question</strong></p>
  
  <p>Do I need to set the fields using $field name?  </p>
  
  <pre><code>if(document.id('LoadExtension') &amp;&amp; document.id('ExtensionResponse')) { // id of select box
  var sel = document.id('LoadExtension'); // ser select box as var.
  sel.addEvent('change', function(chg) { // add change event to select box.
      if(sel.getSelected().get('value') != '') { // on change if selected value is not empty.
          new Request.HTML({
              url : 'http://domain.co.nz/index.php?extension='+ sel.getSelected().get('value'),
              onRequest: function() {
  
              },
              onComplete: function(r1, r2, html, js) {
                  document.id('ExtensionResponse').set('html', html);
              }
          }).send();
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>The above code was set up to get from another document in the url: box but I would like to do it in one page.</p>