title: Javascript error: Object #<HTMLFormElement> has no method 'getElementById'
body: <p>I'm getting a Javascript error: Object # has no method 'getElementById'. I'm trying to have a button that transfers a selected element to another select box in HTML. Have looked everywhere but nobodies solution seems to work for me =\</p>
  
  <p>Javascript</p>
  
  <pre><code>&lt;script language="javascript"&gt;
  function addDivision()
  {
      var selected = document.frmSubmit.getElementById("selectedDivisions");
  
      var div = document.frmSubmit.getElementById("divisions");
      var divId = div.options[div.selectedIndex].value;
      var divText = div.options[div.selectedIndex].text;
  
      var newOption = document.frmSubmit.createElement(divId);
      newOption.text = divText;
  
      selected.add(newOption,null);
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;div id="content"&gt;
  &lt;form id="frmSubmit" name="frmSubmit" action=""&gt;
  
  
  &lt;div id="Step1Content"&gt;
      &lt;h2 style="float:left"&gt;Step 1:&lt;/h2&gt;&lt;p style="float:left; padding-top:10px; padding-left:20px;"&gt;Select your divisions&lt;/p&gt;
      &lt;div style="clear:both"&gt;
          &lt;select id= "divisions" name="divisions" size="8"&gt;
      &lt;?  //Getting divisions based on League_id
          $getDivisionsSQL = "Select * FROM level WHERE League_ID = '1' AND disabled = '0'";
          $getDivisionsQuery = $db-&gt;Query($getDivisionsSQL);
          while( $divRow = $db-&gt;GetRow($getDivisionsQuery) )
          {
              echo "&lt;option id=".$divRow['id']."&gt;".$divRow['description']."&lt;/option&gt;";
          }
      ?&gt;
          &lt;/select&gt;
      &lt;?  
          echo "&lt;img id='doAdd' width='40px' height='25px' style='position: relative; bottom:75px; cursor:pointer;' src='".$baseImagesPath."greenArrow.png'/&gt;";
          echo "&lt;img id='doAdd' width='40px' height='25px' cursor:pointer; style='position: relative; bottom: 25px; right:40px; cursor:pointer;' src='".$baseImagesPath."redArrow.png'/&gt;";
      ?&gt;  
          &lt;select style="position:relative; right:40px;" name="selectedDivisions" id="selectedDivisions" size="8"&gt;
      &lt;?  //List of divisions to use
  
      ?&gt;  &lt;option&gt;Apple&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  
  
  
  
  &lt;div style="padding-top:50px; padding-left:50px; width:100%; float:left; "&gt;
      &lt;h2 style="float:left"&gt;Step 2:&lt;/h2&gt;&lt;p style="float:left; padding-top:10px; padding-left:20px;"&gt;Select the starting date of games&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;div style="padding-top:50px; padding-left:50px; width:100%; float:left"&gt;
      &lt;h2 style="float:left"&gt;Step 3:&lt;/h2&gt;&lt;p style="float:left; padding-top:10px; padding-left:20px;"&gt;Select the total number of weeks in the season&lt;/p&gt;
  
  &lt;div style="padding-top:50px; width:100%; float:left"&gt;
      &lt;input type="submit" value="Create Schedule"&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>