title: trying to make a pizza form for school but something is not working properly
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt; 
  &lt;html lang="en"&gt;
  &lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="ie=edge"&gt;
    &lt;title&gt;pizza&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;script&gt;
      var sizeflag = false, topflag = false, crustflag = false,paymentflag = false;
      function check(){
        checkSize()
        checkToppings()
        checkCrust()
        checkPayment()
  
        if (sizeflag &amp;&amp; topflag &amp;&amp; crustflag &amp;&amp; paymentflag)
          alert("Your pizza is on the way see you soon",
          "you got a " +sizeflag+"pizza with"+topflag+crustflag+"and you want to pay"+paymentflag);
      } 
  
      function checkSize(){ 
        var spot = document.getElementsByName("size");
        ((spot[0].checked)||(spot[1].checked)||(spot[2].checked)||(spot[3].checked))
        sizeflag = true;
        else alert("You haven't chosen your pizza size"); 
        console.log(sizeflag);
      }
  
      function checkToppings(){ 
        if ((document.getElementById("pepporoni").checked)||
          (document.getElementById("mushroom").checked)||
          (document.getElementById("onions").checked)||
          (document.getElementById("sausage").checked)||
          (document.getElementById("bacon").checked)||
          (document.getElementById("extra cheese").checked)||
          (document.getElementById("black olives").checked)||
          (document.getElementById("green peppers").checked))
          topflag = true;
        else alert("You haven't chosen any toppings");       
          console.log(topflag);    
      }
  
      function checkCrust(){ 
        var spot = document.getElementsByName("crust");
        if ((spot[0].checked)||(spot[1].checked)||(spot[3].checked))
          crustflag = true;
        else alert("You haven't chosen your crust"); 
          console.log(crustflag);
      }
  
      function checkPayment(){ 
        var spot = document.getElementsByName("payment");
        if ((spot[0].checked)||(spot[1].checked)||(spot[2].checked))
          paymentflag = true;
        else alert("You haven't chosen your payment size"); 
          console.log(paymentflag); 
      }
    &lt;/script&gt;
  
    &lt;form&gt;
      Size: &lt;br/&gt;
      &lt;input type ="radio" name ="size" id ="small"/&gt;small&lt;/br&gt;
      &lt;input type ="radio" name ="size" id="medium"/&gt; medium&lt;/br&gt;
      &lt;input type ="radio" name ="size" id = "large"/&gt; large&lt;/br&gt;
      &lt;input type ="radio" name ="size" id = "extralarge"/&gt; extra large&lt;/br&gt;
      &lt;/br&gt;
      &lt;/br&gt;
      &lt;/br&gt;
      toppings: &lt;br/&gt;
      &lt;input type ="checkbox" id ="pepporoni"/&gt;pepperoni&lt;/br&gt;
      &lt;input type ="checkbox" id ="mushrooms"/&gt; Mushrooms&lt;/br&gt;
      &lt;input type ="checkbox" id ="onions"/&gt; Onions&lt;/br&gt;
      &lt;input type ="checkbox" id ="sausage"/&gt; Sausage&lt;/br&gt;
      &lt;input type ="checkbox" id ="bacon"/&gt;Bacon&lt;/br&gt;
      &lt;input type ="checkbox" id ="extra cheese"/&gt; Extra cheese&lt;/br&gt;
      &lt;input type ="checkbox" id = "black olives"/&gt; Black olives&lt;/br&gt;
      &lt;input type ="checkbox" id = "green peppers"/&gt; green peppers&lt;/br&gt;
      &lt;/br&gt;
      &lt;/br&gt;
      &lt;/br&gt;
      Type of Crust: &lt;br/&gt;
      &lt;input type ="radio" name=crust id ="thin"/&gt;thin&lt;/br&gt;
      &lt;input type ="radio" name=crust id="thick"/&gt; thick&lt;/br&gt;
      &lt;input type ="radio" name=crust id = "stuffed"/&gt; stuffed&lt;/br&gt;
      &lt;/br&gt;
      &lt;/br&gt;
      &lt;/br&gt;
      Method payment: &lt;br/&gt;
      &lt;input type ="radio" name=payment id ="Debatdoor"/&gt;debit at the door&lt;/br&gt;
      &lt;input type ="radio" name=payment id="credatdoor"/&gt; credit at the door&lt;/br&gt;
      &lt;input type ="radio" name=payment id = "cashatdoor"/&gt; cash at the door&lt;/br&gt;
      &lt;input type = "button" onclick="check()" value ="Submit"/&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>