title: Using javascript to calculate form
body: <p>I have a question on how to use javascript to calculate a form, but I can't seem to get it. Sorry if it's obvious but I'm new to scripting. Okay, so I have a form in html where you can select different options:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if (((document.getElementById("age").value = "15")||(document.getElementById("gender").value = "male")||(document.getElementById("psy").value = "sedentary")))
    {
    return("2200cal");
    }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
    &lt;div class="row"&gt;
      &lt;label for="age"&gt;Age&lt;/label&gt;
      &lt;input type="text" id="age" name="age" placeholder="Enter age"&gt;
      &lt;div class="row"&gt;
        &lt;label for="gender"&gt;Gender&lt;/label&gt;
        &lt;select id="gender" name="gender"&gt;
          &lt;option value="" disabled selected hidden&gt;Select gender&lt;/option&gt;
          &lt;option value="male"&gt;Male&lt;/option&gt;
          &lt;option value="female"&gt;Female&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="row"&gt;
      &lt;label for="fname"&gt;Physical Activity&lt;/label&gt;
      &lt;select id="psy" name="psy"&gt;
        &lt;option value="" disabled selected hidden&gt;Select activity level&lt;/option&gt;
        &lt;option value="sedentary"&gt;SEDENTARY&lt;/option&gt;
        &lt;option value="mod"&gt;MOD. ACTIVE&lt;/option&gt;
        &lt;option value="active"&gt;ACTIVE&lt;/option&gt;
      &lt;/select&gt;
  &lt;input type="submit" value="Submit" onclick="if"&gt;
    &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and using it I wanted to use javascript to output a number based on this chart:
  <a href="https://i.stack.imgur.com/VKjIb.png" rel="nofollow noreferrer">output chart</a></p>
  
  <p>I tried using an equation to output a value by using if and then statements but it doesn't work, especially when it needs to find the result from all three variables together in the code.</p>
  
  <p>Edit: fixed values but still not outputting anything.</p>