title: how do i keep form data after submitting the form using javascript?
body: <p>When i submit this form, the values just disappears from the textboxes. I like them to stay printed in the textboxes. How do i do that?</p>
  
  <pre><code>&lt;form id="myform" method="get" action="" onSubmit="hello();"&gt;
  
         &lt;input id="hour" type="text" name="hour" style="width:30px; text-align:center;" /&gt; :
         &lt;input id="minute" type="text" name="minute" style="width:30px; text-align:center;" /&gt;
         &lt;br/&gt;
         &lt;input type="submit" value="Validate!" /&gt;
      &lt;/form&gt;
  
      &lt;style type="text/css"&gt;
      .error {
          color: red;
          font: 10pt verdana;
          padding-left: 10px
      }
      &lt;/style&gt;
  &lt;script type="text/javascript"&gt;
  function hello(){
  
      var hour = $("#hour").html();
      alert(hour);
  }
      $(function() {
          // validate contact form on keyup and submit
          $("#myform").validate({
              //set the rules for the fild names
              rules: {
                  hour: {
                      required: true,
                      minlength: 1,
                      maxlength: 2,
                      range:[0,23]
                  },
                  minute: {
                      required: true,
                      minlength: 1,
                      maxlength: 2,
                      range:[0,60]
                  },
              },
              //set messages to appear inline
              messages: {
                  hour: "Please enter a valid hour",
                  minute: "Please enter a valid minute"
              }
          });
  
  
      });
      &lt;/script&gt;
  </code></pre>