1
0
-1

This is my code ,

<script type="text/javascript">
$(document).ready(function(){
$("#assignmentComplete").on("click", function(){
     if(confirm("Are you sure to send email ?")){
          return true;
     }else{
          return false;
     }
});
});
</script>



And this is , On submit form

 

And this is , On click cancel

 

 

Why, I don't see 'Please wait...'


Please Help Me!!!

 

    CommentAdd your comment...

    3 answers

    1.  
      3
      2
      1

      I have improved Matthew's code to handle Joget v5 use of blockUI.

      $(document).ready(function() {
      		//cancel default click event in 1 second
      		setTimeout(function(){
      		    //uncomment this while loop if fails to remove default click event
      			//while( $("#section-actions button, #section-actions input").data("events") ){
      			  $("#section-actions button, #section-actions input").off("click");
      			//}
      			
      			$("#assignmentComplete,#submit").on("click", function(event) {
      				if (confirm("Are you sure to send email ?")) {
      					$.blockUI({ css: { 
      						border: 'none', 
      						padding: '15px', 
      						backgroundColor: '#000', 
      						'-webkit-border-radius': '10px', 
      						'-moz-border-radius': '10px', 
      						opacity: .3, 
      						color: '#fff' 
      					}, message : "<h1>Please wait...</h1>" }); 
      					return true;
      				} else {
      					return false;
      				}
      			});
      		}, 1000);
          });
      1. Danial Jefri

        Where can we insert this code in the form?


      CommentAdd your comment...
    2.  
      1
      0
      -1

      Oh, Thank You Very Much

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Sa Varee

        There is two possible submit id "#assignmentComplete or #submit", just add a "#submit" to your jquery as follows:

        <script type="text/javascript">
            $(document).ready(function() {
                $("#assignmentComplete,#submit").on("click", function() {
                    if (confirm("Are you sure to send email ?")) {
                        return true;
                    } else {
                        return false;
                    }
                });
            });
        </script>
          CommentAdd your comment...