title: If I don't press write button, I want to show an alert
body: <p>I assign the element id "btn_submit" to write_ok button.</p>
  
  <p>I wanted the following:</p>
  
  <p>if I press write_ok button,<br>
  &nbsp; do write,<br>
  else (if I do not press write_ok button)<br>
  &nbsp; do alert message before page exit.</p>
  
  <p>I don't know how can i find out which button was pressed.</p>
  
  <p>I found this, but I cannot get it to work: <a href="https://stackoverflow.com/questions/5721724/jquery-how-to-get-which-button-was-clicked-upon-form-submission">jQuery: how to get which button was clicked upon form submission?</a></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(window).bind('beforeunload', function(){
      if ( #btn_submit was not pressed )
          return 'If you exit the page, you may lose your changes';
  });
  &lt;/script&gt;
  </code></pre>