title: Passing HTML Form Data to Javascript Function
body: <p>I've created a form with one drop down menu to choose from as well as three other text fields for users to input data. </p>
  
  <p>I need to perform calculations on the data the user inputs and then display the results. </p>
  
  <p>For now, I just want to be able to pass the results into the function and print the results. From there I'll figure out how to display those outputs into a table.</p>
  
  <p>Right now, I'm having trouble identifying the specific element's value. With the drop down menu I'm able to identify the chosen value by writing  <code>document.getElementById("activity_level").value</code>. The rest of the values won't appear when I run the function. I'm assuming that I'm not identifying the value type so the browser knows what the display is. </p>
  
  <p>Here is my HTML:</p>
  
  <pre><code>&lt;form&gt;
          Activity Level: &lt;select id="activity_level"&gt;
                          &lt;option value="null"&gt;Please Choose One...&lt;/option&gt;
                          &lt;option value="1.25"&gt;Practically a Vegetable&lt;/option&gt;
                          &lt;option value="1.35"&gt;Mostly Desk Work and Light Walking&lt;/option&gt;
                          &lt;option value="1.55"&gt;Moderate Exercise 2-3 Times Per Week&lt;/option&gt;
                          &lt;option value="1.75"&gt;Heavy Exercise 3-4 Times Per Week&lt;/option&gt;
                          &lt;option value="1.95"&gt;Committed Hardcore Athlete&lt;/option&gt;
                          &lt;/select&gt;&lt;/br&gt;
          BodyFat Percentage &lt;input type="text" id="bfp" /&gt; &lt;/br&gt;
          Total Weight &lt;input type="text" id="tw" /&gt;&lt;/br&gt;
          Target Bodyfat Percentage &lt;input type="text" id="target_bodyfat_pct" /&gt;&lt;/br&gt;
          &lt;input type="button" value="Calculate" onclick="Calculate()" /&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>Here is my javascript:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
  
      function Calculate(){
          //document.write(bfp + "&lt;/br&gt;");
          document.write(document.getElementById("activity_level").value + "&lt;/br&gt;");
          //document.write(document.getElementById("tw") + "&lt;/br&gt;");
          //document.write(document.getElementById("target_bodyfat_pct"));
      }
  
      &lt;/script&gt;
  </code></pre>