Jquery Mobile Popup Does Not Open After Closing Previous Popup
I have a jQuery popup that takes in user input which can lead to errors. I want to have a 2nd popup come up if there are errors, but I cannot get this working. Here is a boiled do
Solution 1:
According to this Documentation (see at the page end) Chaining popups are not allowed in jquery mobile.
You can achive the chaining popup like the following.
$( document ).on( "pageinit", function() {
$( '.popupParent' ).on({
popupafterclose: function() {
setTimeout( function(){ $( '.popupChild' ).popup( 'open' ) }, 100 );
}
});
});
Refer this Fiddle Demo
Solution 2:
Check your browser pop-up blocker. So setinterval needs to be used to trigger it.
Simply write your js like this,
window.create_folder_submit = function () {
$("#addFolderDialog").popup("close");
$("#errormsg").text("ERROR!");
var popup = setInterval(function(){
$("#errorDialog").popup('open');
clearInterval(popup);
},1);
};
Solution 3:
Actually using popupafterclose event can't work since it will be fired every time you will leave the popup. even if you click on "cancel". You should make a simple delay between the closing and the opening.
Post a Comment for "Jquery Mobile Popup Does Not Open After Closing Previous Popup"