title: Javascript if/else on submit
body: <p>im totally new to javascript and im currently working on my first functions.
  I have these 2 text input area where one can put his name and his level.</p>
  
  <pre><code>&lt;form action="/action_page.php"&gt;
  Nom: &lt;input type="text" name="fullname"&gt;&lt;br&gt;&lt;br&gt;
  Niveau (1 &amp;aacute; 6): &lt;input type="text" name="niveau"&gt;
  &lt;input type="submit" value="Afficher partie 2"&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>After submitting, the user is supposed to be shown a message with his name and his level (if level is between 1-6, else its an error message). </p>
  
  <p>This is how i wrote my script:</p>
  
  <pre><code>&lt;script&gt;
  var x = oninput;
  var y = oninput;
  if (y&gt;=1){
    document.write("Bonjour + 'x'");
    document.write("Niveau='y'");
  }if (y&lt;=6){
    document.write("Bonjour + 'x'");
    document.write("Niveau='y'");
  }
  else {
    document.write("&lt;p style="color:red;"&gt;Erreur le niveau doit etre en  
    1 et 6&lt;/p&gt;
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I really wanted to know if I wrote that the right way, I also cant figure how to show the user his name with the variable X. </p>
  
  <p>I also have a problem understanding how to link my script to the input box.</p>