jquery - Dialog box not showing on the second click of the confirmation box ok button? -


i have button named submit, when click button got confirmation box. if click ok button on confirmation box got dialog box. if cancel dialog box , try once again not able see dialog box.

html looks this

        <input type="submit" id="btnsubmit" class="button" value="<%= osfladminresources.text_users_permanently_delete_selected_users %>"             onclick="return validate();" /> 

jquery :-

    function validate()          {                if(confirm("<%= osfladminresources.text_delete_warning_popup_message %>"))                {                   dialog();                   return false;                }                else                {                return false;                }          }        function dialog()      {              $("#dialogtoshow").dialog({                         title: "confirm password",                         closetext: "cancel",                         show:"slide",                         resizable: false,                         modal: true,                           open: function(ev, ui){                           $('.ui-widget-overlay').stop().animate({"opacity": "0.40"}, 1480);                           },                           close: function(ev, ui){                           $('.ui-widget-overlay').stop().animate({"opacity": "0"}, 1480);                           }                                             });                                  return false;      } 

can body me in solving this?

the problem is, try reinitialize dialog 2nd time. not possible. assign dialog variable , use reference opening dialog. sure set autoopen: false.

try following:

var $dialog = null; function dialog() {     // create dialog if not done     if (!$dialog) {         $dialog = $("#dialogtoshow").dialog({             title: "confirm password",             closetext: "cancel",             show:"slide",             resizable: false,             modal: true,             autoopen: false, // important! prevent auto open             open: function(ev, ui){                 $('.ui-widget-overlay').stop().animate({"opacity": "0.40"}, 1480);             },             close: function(ev, ui){                 $('.ui-widget-overlay').stop().animate({"opacity": "0"}, 1480);             }                           });     }     // use reference dialog , call open.     $dialog.dialog('open');     return false; } 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -