Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You had one of your ids (Goal) spelled with a capital letter and your button was a submit type so it was trying to submit it to the server. </p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;title&gt;Daily Calorie Goal&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript" language="javascript"&gt; function Calculate() { var gender = document.getElementById("gender").value; var weight = document.getElementById("weight").value; var height = document.getElementById("height").value; var age = document.getElementById("age").value; var goal = document.getElementById("goal").value; if(gender=="male") { val1 = 6.23 * weight; val2 = 12.7 * height; val3 = 6.8 * age; dailyDeficit = (goal * 3500) / 90; result = 66 + val1 + val2 - val3; cals = result * 1.55; calMax = cals - dailyDeficit; } else if (gender=="female") { val1 = 6.23 * weight; val2 = 4.7 * height; val3 = 4.7 * age; dailyDeficit = (goal * 3500) / 90; result = 655 + val1 + val2 - val3; cals = result * 1.55; calMax = cals - dailyDeficit; } document.write ('This is your Daily Calorie Goal. To achieve your goal, just consume fewer than this number of calories every day:&lt;b&gt; ' + calMax.toFixed(2) + '&lt;/b&gt;&lt;br&gt;'); } &lt;/script&gt; &lt;form action="#"&gt; Gender : &lt;select id="gender"&gt;&lt;option value="male"&gt;Male&lt;/option&gt;&lt;option value="female"&gt;Female&lt;/option&gt;&lt;/select&gt;&lt;br /&gt; Weight (lbs.) : &lt;input type="text" id="weight" /&gt;&lt;br /&gt; Height (inches): &lt;input type="text" id="height" /&gt;&lt;br /&gt; Age : &lt;input type="text" id="age" /&gt;&lt;br /&gt; Goal : &lt;select id="goal"&gt;&lt;option value=5&gt;Lose 5 Pounds&lt;/option&gt;&lt;option value=10&gt;Lose 10 Pounds&lt;/option&gt;&lt;option value=15&gt;Lose 15 Pounds&lt;/option&gt;&lt;option value=20&gt;Lose 20 Pounds&lt;/option&gt;&lt;option value=25&gt;Lose 25 Pounds&lt;/option&gt;&lt;/select&gt;&lt;br /&gt; &lt;/fieldset&gt; &lt;input type="button" value="Get My Daily Calorie Goal" onclick="Calculate()" /&gt; &lt;/form&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload