title: Javascript Document Window
body: <p>Why wont my popup window pop up?
  My user should enter information for an appointment. Once Submit is hit a document window should pop up. The submit button appears to work. The clear button is working also. I programmed a function to handle the window and set the onSubmit to return the function. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> &lt; script type = "text/javascript" &gt;
     function popUpWindow() { //window should return user's name in a window
       newWin = window.open('', 'NewWin', 'toolbar=no,status=no,width=500,height=200');
       newWin.document.write("&lt;body bgcolor='yellow'&gt;&lt;h3&gt;Appointment Confirmation&lt;/h3&gt;);
       newWin.document.write("
           Your name is: " + document["
           form "].name.value);
       newWin.document.close();
      }
      &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  
  &lt;head&gt;
    &lt;title&gt;Project&lt;/title&gt;
  &lt;/head&gt;
  //this form should accept user's input
  
  &lt;body&gt;
    &lt;form name="form" onSubmit="return popUpWindow();"&gt;
      Please enter your name:
      &lt;input type="text" name="name" value="" size="50" /&gt;
      &lt;/p&gt;
      &lt;p&gt;
        Address:
        &lt;input type="text" name="address" size="50" /&gt;
      &lt;/p&gt;
      &lt;p&gt;
        Phone:
        &lt;input type="text" name="area_code" size="10" /&gt;
      &lt;/p&gt;
      &lt;p&gt;
        Email:
        &lt;input type="text" name="email" value="" size="20" /&gt;
      &lt;/p&gt;
      &lt;p&gt;
        &lt;legend&gt;Stylist&lt;/legend&gt;
      &lt;/p&gt;
      &lt;input type="radio" name="stylist" id="stylist1" value="dream" /&gt;Dream
      &lt;input type="radio" name="stylist" id="stylist2" value="aubrey" /&gt;Aubrey
      &lt;input type="radio" name="stylist" id="stylist3" value="stag" /&gt;Stag
      &lt;input type="radio" name="stylist" id="stylist1" value="halo" /&gt;Halo
      &lt;p&gt;
        &lt;legend&gt;Services&lt;/legend&gt;
      &lt;/p&gt;
      &lt;input type="checkbox" name="service" id="service1" value="cut" /&gt;Cut
      &lt;br/&gt;
      &lt;input type="checkbox" name="service" id="service2" value="relaxer" /&gt;Relaxer
      &lt;br/&gt;
      &lt;input type="checkbox" name="service" id="service1" value="weave" /&gt;Weave
      &lt;br/&gt;
      &lt;input type="checkbox" name="service" id="service1" value="braids" /&gt;Braids
      &lt;br/&gt;
      &lt;input type="checkbox" name="service" id="service1" value="wash" /&gt;Wash and Style
      &lt;br/&gt;
      &lt;input type="checkbox" name="service" id="service1" value="natural" /&gt;Natural
      &lt;br/&gt;
      &lt;p&gt;Leave Comments&lt;/p&gt;
      &lt;textarea name="comments" id="comments" align="left" rows "8" cols "75"&gt;&lt;/textarea&gt;
      &lt;input type="submit" value="Submit" /&gt;
      &lt;input type="reset" value="Clear" /&gt;
    &lt;/form&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>