title: How can I use the JavaScript onchange event to submit a form?
body: <p>I have code like this:</p>
  
  <pre><code>&lt;form action="checkin.php" method="post"&gt;
      &lt;select name="roomname" onchange="???"&gt;
          &lt;option value=""&gt;New Room:&lt;/option&gt;
          &lt;option value="room1"&gt;Room 1:&lt;/option&gt;
          &lt;option value="room2"&gt;Room 2:&lt;/option&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to set up an action so that when an option is selected to direct the user to the <code>checkin.php</code> page without them having to use a submit button. I've been told to use <code>onChange</code>, but I don't know how to use it.</p>