title: Refresh page on Cancel prompt
body: <p>Problem:</p>
  
  <p>I have a web page. When I fill in the data and hit save, it gives me a a confirmation pop up box. On cancel I want to refresh the page. So the data entered is cleared.</p>
  
  <p>Here is the code for confirmation so far:</p>
  
  <pre><code>function checknumber() {
      var x = document.getElementById('&lt;%=view_txt_pixelwidth.ClientID%&gt;').value;
      var y = document.getElementById('&lt;%=view_txt_pixelheight.ClientID%&gt;').value;
      var z = document.getElementById('&lt;%=view_txt_printleft.ClientID%&gt;').value;
      var a = document.getElementById('&lt;%=view_txt_printtop.ClientID%&gt;').value;
      var b = document.getElementById('&lt;%=view_txt_printwidth.ClientID%&gt;').value;
      var c = document.getElementById('&lt;%=view_txt_printheight.ClientID%&gt;').value;                       
  
      var anum = /(^\d+$)|(^\d+\.\d+$)/
      if ((anum.test(x)) &amp;&amp; (anum.test(y)) &amp;&amp; (anum.test(z)) &amp;&amp; (anum.test(a)) &amp;&amp; (anum.test(b)) &amp;&amp; (anum.test(c)))
          testresult = confirm('save change?');
      else {
          alert("Please input a valid number!")
          testresult = false
      }
      return (testresult);
  }                        
  function Validate_view() {
      var value = document.getElementById('&lt;%=view_txt_name.ClientID%&gt;').value;
      var value2 = document.getElementById('&lt;%=view_txt_title.ClientID%&gt;').value;
      var value3 = document.getElementById('&lt;%=view_txt_description.ClientID%&gt;').value;
      var value4 = document.getElementById('&lt;%=view_txt_pixelwidth.ClientID%&gt;').value;
      var value5 = document.getElementById('&lt;%=view_txt_pixelheight.ClientID%&gt;').value;
      if (value == '' || value2 == '' || value3 == '' || value4 == '' || value5 == '') {
          ValidatorEnable(document.getElementById('&lt;%= view_req_pixelwidth.ClientID %&gt;'), true);
          ValidatorEnable(document.getElementById('&lt;%= view_req_pixelheight.ClientID %&gt;'), true);
          ValidatorEnable(document.getElementById('&lt;%= view_req_name.ClientID %&gt;'), true);
          ValidatorEnable(document.getElementById('&lt;%= view_req_title.ClientID %&gt;'), true);
          ValidatorEnable(document.getElementById('&lt;%= view_req_description.ClientID %&gt;'), true);
      }
      if (value == '' || value2 == '' || value3 == '' || value4 == '' || value5 == '') {
          alert("Please enter the missing fields");
          return false;
      }
      else if (document.layers || document.all || document.getElementById) {
          return checknumber();                            
      }
  
  
  
      &lt;asp:Button ID="view_btn_save" Text="Save" OnClick="view_btn_save_click"
      OnClientClick="return Validate_view(); "
  }
  </code></pre>