title: Html/ javascript form calculation issues
body: <p>I'm new to coding for websites and am really struggling! I'm trying to add the select values from different select menu options to a total which will then give me a figure I can add to a number entered in a free text box. </p>
  
  <p>I"ve searched extensively on the net and on this site and have found examples that are similar but when I've tried them out it doesn't work with my additions/changes!</p>
  
  <p>Any help would be greatly appreciated!!!! Below is my html and also javascript. </p>
  
  <p>Thanks in advance!</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  
  &lt;script type="text/javascript" src="example.js"&gt;&lt;/script&gt;
  
  
  &lt;/head&gt;
  
  &lt;form action="" id="myform" onsubmit="return false;"&gt;
          &lt;div class="cont_order"&gt;
  
  &lt;div data-role="fieldcontain"&gt;
            &lt;label for="selectmenu" class="select"&gt;
              &lt;div align="right"&gt;&lt;/div&gt;
            &lt;/label&gt;
            &lt;div align="center"&gt;&lt;/div&gt;
      &lt;/div&gt;
          &lt;div align="center"&gt;
            &lt;/p&gt;
  
  
            &lt;select name="Sport" id="Sport" data-native-menu="false" data-theme="a" onchange="calculateTotal()"&gt;
              &lt;option value="0"&gt;Sport&lt;/option&gt;
              &lt;option value="Tennis"&gt;Tennis&lt;/option&gt;
              &lt;option value="Golf"&gt;Golf&lt;/option&gt;
              &lt;option value="Soccer"&gt;Soccer&lt;/option&gt;
              &lt;option value="Rugby"&gt;Rugby&lt;/option&gt;
              &lt;option value="Polo"&gt;Polo&lt;/option&gt;
              &lt;option value="Fencing"&gt;Fencing&lt;/option&gt;
              &lt;option value="Swimming"&gt;Swimming&lt;/option&gt;
            &lt;/select&gt;
  
            &lt;br/&gt;
  
  
            &lt;label for="selectmenu" class="select"&gt;
              &lt;div align="right"&gt;&lt;/div&gt;
            &lt;/label&gt;
            &lt;div align="center"&gt;&lt;/div&gt;
      &lt;/div&gt;
          &lt;div align="center"&gt;
            &lt;/p&gt;
  
  
            &lt;select name="Star Sign" id="SS" data-native-menu="false" onchange="calculateTotal()"&gt;
              &lt;option value="0"&gt;Star Sign&lt;/option&gt;
              &lt;option value="1.5"&gt;Aries&lt;/option&gt;
              &lt;option value="3"&gt;Taurus&lt;/option&gt;
              &lt;option value="1.5"&gt;Gemini&lt;/option&gt;
              &lt;option value="2"&gt;Cancer&lt;/option&gt;
              &lt;option value="3"&gt;Leo&lt;/option&gt;
              &lt;option value="1.5"&gt;Virgo&lt;/option&gt;
              &lt;option value="2"&gt;Libra&lt;/option&gt;
              &lt;option value="3"&gt;Scorpio&lt;/option&gt;
              &lt;option value="2"&gt;Sagittarius&lt;/option&gt;
              &lt;option value="1.5"&gt;Capricorn&lt;/option&gt;
              &lt;option value="0.5"&gt;Aquarius&lt;/option&gt;
              &lt;option value="0.5"&gt;Pisces&lt;/option&gt;
            &lt;/select&gt;
  
  &lt;br/&gt;
  
  
            &lt;label for="selectmenu" class="select"&gt;
              &lt;div align="right"&gt;&lt;/div&gt;
            &lt;/label&gt;
            &lt;div align="center"&gt;&lt;/div&gt;
      &lt;/div&gt;
          &lt;div align="center"&gt;
            &lt;/p&gt;
  
            &lt;br/&gt;
  
            &lt;select name="Hobby" id="Hobby" data-native-menu="false" onchange="calculateTotal()"&gt;Hobby
              &lt;option value="0"&gt;Hobby&lt;/option&gt;
              &lt;option value="A lot"&gt;A lot&lt;/option&gt;
              &lt;option value="Some"&gt;Some&lt;/option&gt;
              &lt;option value="Few"&gt;Few&lt;/option&gt;
              &lt;option value="None"&gt;None&lt;/option
            &lt;/select&gt; 
      &lt;/div&gt;
  
      &lt;br/&gt;
  
            &lt;label for="selectmenu" class="select"&gt;
              &lt;div align="right"&gt;&lt;/div&gt;
            &lt;/label&gt;
            &lt;div align="center"&gt;&lt;/div&gt;
        &lt;/div&gt;
          &lt;div align="center"&gt;
            &lt;/p&gt;
  
            &lt;br/&gt;
  
  
            &lt;select name="Favourite Colour" id="FC" data-native-menu="false" onchange="calculateTotal()"&gt;
              &lt;option value="0"&gt;Favourite Colour&lt;/option&gt;
              &lt;option value="1.5"&gt;Black&lt;/option&gt;
              &lt;option value="3"&gt;Blue&lt;/option&gt;
              &lt;option value="1.5"&gt;Brown&lt;/option&gt;
              &lt;option value="2"&gt;Green&lt;/option&gt;
              &lt;option value="3"&gt;Orange&lt;/option&gt;
              &lt;option value="1.5"&gt;Pink&lt;/option&gt;
              &lt;option value="2"&gt;Purple&lt;/option&gt;
              &lt;option value="3"&gt;Red&lt;/option&gt;
              &lt;option value="2"&gt;Yellow&lt;/option&gt;
              &lt;option value="1.5"&gt;White&lt;/option&gt;
              &lt;option value="4"&gt;Other&lt;/option&gt;
  
            &lt;/select&gt;
  
            &lt;br/&gt;
  
          &lt;p&gt;&amp;nbsp;     
  
   &lt;br/&gt;
  
  
  
      &lt;div data-role="fieldcontain"&gt;
            &lt;label for="Age"&gt;
              &lt;div align="center"&gt;Age
                :
              &lt;/div&gt;
            &lt;/label&gt;
            &lt;div align="center"&gt;
              &lt;input type="number" name="Age" id="Age" value=""  /&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;/form&gt;
          &lt;p&gt;&amp;nbsp;&lt;/p&gt;
  
          &lt;p&gt;&amp;nbsp;&lt;a href="#" data-role="button"&gt;    &lt;input type='submit' id='Submit' value='submit' onclick="calculateTotal()"/&gt;
  
          &lt;br/&gt;
          &lt;/div&gt;
  
          &lt;/form&gt;
  
  
  
  
  &lt;/div&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  
  
  
  // JavaScript Document
  
  var Sport = new Array();
  Sport["Tennis"]=1.5;
  Sport["Golf"]=3;
  Sport["Soccer"]=2;
  Sport["Rugby"]=3;
  Sport["Polo"]=1.5;
  Sport["Fencing"]=2;
  Sport["Swimming"]=3; 
  
  var SS = new Arr4ay();
  Star_Sign["Aries"]=1.5;
  Star_Sign["Taurus"]=3;
  Star_Sign["Cancer"]=2;
  Star_Sign["Leo"]=3;
  Star_Sign["Virgo"]=1.5;
  Star_Sign["Libra"]=2;
  Star_Sign["Scorpio"]=3;
  Star_Sign["Sagittarius"]=2;
  Star_Sign["Capricorn"]=1.5;
  Star_Sign["Aquarius"]=0.5;
  Star_Sign["Pisces"]=1.5;
  
  var Hobby = new Array();
  Hobby["A lot"]=0.5;
  Hobby["Some"]=1;
  Hobby["Few"]=1;
  Hobby["None"]=2;
  
  
  var FC = new Array();
  Favourite_Colour["Blue"]=3;
  Favourite_Colour["Brown"]=1.5;
  Favourite_Colour["Green"]=2;
  Favourite_Colour["Orange"]=3;
  Favourite_Colour["Pink"]=1.5;
  Favourite_Colour["Purple"]=2;
  Favourite_Colour["Red"]=3;
  Favourite_Colour["Yellow"]=2;
  Favourite_Colour["White"]=1.5;
  Favourite_Colour["Other"]=4;
  
  
  function calc() {
      var Sport = Number(document.getElementsById("Sport").value);
      var SS = Number(document.getElementsById("SS").value);
      var Hobby = Number(document.getElementsById("Hobby").value);
      var FC = Number(document.getElementsById("FC").value);
      var Age = Number(document.getElementsById("Age").value);
  
      var total = Sport + SS + Hobby + FC;
  
      var Score = Age = Score
  
  
  }// JavaScript Document
  </code></pre>