title: form resetting in javascript
body: <p>I'm trying to reset a form with a confirm window.  My html looks like:</p>
  
  <pre><code>&lt;input type="reset" value="Reset" onclick="showReset();"/&gt;
  </code></pre>
  
  <p>then for my javascript:</p>
  
  <pre><code>function doReset() {
      var formElements = document1.form1.elements;
      for (var i = 0; i &lt; formElements.length; i++) {
          formElements[i].value = "";
          if (formElements[i].checked) {
              formElements[i].checked = false;
          }
      }
  }
  
  function showReset() {
      if (window.confirm("Do you really want to reset the form?")) {
          doReset();
      }
  }
  </code></pre>
  
  <p>When I hit cancel on the confirm window, the form still gets reset and I'm not sure why.  Thanks.</p>