title: Jquery displaying confirmation dialog on form submit
body: <p>I need to display confirmation dialog on image click. Code in "onclick" section of image should be only executed if jquery confirmation dialog returned true.</p>
  
  <p>At this point when user clicks on $(".submit_image") - dialog is displayed, but form is still submitted.</p>
  
  <p>The logic should be the same for both jquery.alerts plugin or regular javascript confirm dialog.</p>
  
  <pre><code>&lt;form name="myform"&gt;
  &lt;img class="submit_image" onclick="myform.field1.value='1';myform.field1.value='2'; myform.submit();"&gt;
  &lt;/form&gt;
  
  
  $(document).ready(function(){
     // catch submit 
     $(".submit_image").click(function(e){
         jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
        return r;
         });
     });
  });
  </code></pre>