title: Javascript functions. variable result. why undefined or doesn't if else statement function?
body: <p>I need the values of the name, address, size, and topping fields to appear in a text box. Without problems the name and address appears correctly. However I can't seen to get the size function to work. It is a radio button, and thus I need only one size to appear. I haven't even tried an if else for the checkbox yet. Here is my code</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  function pizza() {
      document.pizzaboy.comments.value = "Name:" + " " + pizzaboy.name.value + "\n" + "Address:" + " " + pizzaboy.address.value + "\n" + document.getElementById("small").value + document.getElementById("medium").value + document.getElementById("large").value + "\n" + pizzaboy.toppings.value; 
      {
          var rslt = "";
          if (document.pizzaboy.size[0].checked) {
              rslt = rslt + "Size=Small\n";
          } else if (document.pizzaboy.size[1].checked) {
              rslt = rslt + "Size=Medium\n";
          } else rslt = rslt + "Size=Large\n";
          return rslt;
      }
  }
  &lt;/head&gt;
  </code></pre>