Advertisement
Guest User

Untitled

a guest
Apr 17th, 2014
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. <button id="btn-reject" class="btn btn-danger" type="submit" style="float: right;">Reject Request</button>
  2. <div id='reject-dialog' title='Confirmation Required'>Reject Request?</div>
  3.  
  4. <script type="text/javascript">
  5. $(document).ready(function () {
  6. $("#reject-dialog").dialog({
  7. autoOpen: false,
  8. modal: true,
  9. buttons: {
  10. "Confirm": {
  11. text: "OK",
  12. id: "confirm-reject"
  13. },
  14. "Cancel": {
  15. text: "Cancel",
  16. id: "cancel-reject"
  17. }
  18. }
  19. });
  20. $("#btn-reject").click(function (e) {
  21. e.preventDefault();
  22.  
  23. $("#reject-dialog").dialog('open');
  24. });
  25. $('#cancel-reject').click(function () {
  26. $("#reject-dialog").dialog('close');
  27. console.log('confirm');
  28. });
  29. $('#confirm-reject').click(function () {
  30. $("#reject-dialog").dialog('close');
  31. console.log('reject');
  32. });
  33. }); //dom
  34.  
  35. </script>
  36.  
  37. <script type="text/javascript">
  38. $(document).ready(function () {
  39. var dialogDiv = $("#reject-dialog");
  40. dialogDiv.dialog({
  41. autoOpen: false,
  42. modal: true,
  43. buttons: [
  44. {
  45. text: "OK",
  46. id: "confirm-reject",
  47. click: function() {
  48. dialogDiv.dialog("close");
  49. console.log('confirm');
  50. }
  51. },
  52. {
  53. text: "Cancel",
  54. id: "cancel-reject",
  55. click: function(){
  56. dialogDiv.dialog("close");
  57. console.log('reject');
  58. }
  59. }
  60. ]
  61. });
  62. $("#btn-reject").click(function (e) {
  63. e.preventDefault();
  64.  
  65. dialogDiv.dialog('open');
  66. });
  67. }); //dom
  68.  
  69. </script>
  70.  
  71. $('#cancel-reject').click(function () {
  72. $("#reject-dialog").dialog('close');
  73. console.log('confirm');
  74. });
  75.  
  76. $(document).on('click','#cancel-reject', function () {
  77. $("#reject-dialog").dialog('close');
  78. console.log('confirm');
  79. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement