title: Beginner Javascript Form
body: <p>I have a simple form that i am trying to submit, but i cannot manage to get any values from it.</p>
  
  <p>I have seen multiples examples but none of them seem to be working.</p>
  
  <p>This is my html:</p>
  
  <pre><code>&lt;form name="myForm" action="grade.html" method="get"&gt;
          &lt;label&gt;Name:&lt;/label&gt; &lt;input type="text" name="fname"&gt;
          &lt;br&gt;
          &lt;p&gt;Is the Earth Round or Flat?&lt;/p&gt;
          &lt;input type="radio" name="earth" value="round"&gt;Round&lt;br&gt;
          &lt;input type="radio" name="earth" value="flat"&gt;Flat
          &lt;p&gt;What month is the Earth closest to the sun?&lt;/p&gt;
          &lt;select name="sf"&gt; 
              &lt;option value="jan" &gt;January&lt;/option&gt;
              &lt;option value="feb" &gt;February&lt;/option&gt;
              &lt;option value="jul" &gt;July&lt;/option&gt;
          &lt;/select&gt;
          &lt;br&gt;
          &lt;hr&gt;
          &lt;input type="submit" name="sub" value="Submit"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>This is my javascript in the grade.html. Here I get nothing shown on the document.write() function.</p>
  
  <pre><code>            var grade = 0;
  
              var form = document.forms[0];
              //var x = document.forms["myForm"]["fname"].value;
              //var e = document.forms["myForm"]["earth"].value;
              //var s = document.forms["myForm"]["sf"].value;
  
              document.write(form);
              document.write(form.elements[0]);
  </code></pre>
  
  <p>I don't know what i am doing wrong, but none of them are working.</p>