How to close popup window automatically
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 08:18 PM
Hi All,
I am showing the Popup window using below catalog client script. My requirement here is the popup window should close automatically in few seconds. Please help me how to close the window automatically
Client script :
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
spModal.open({
"title": "Tax Validation",
"message": "Validation is Inprogress, Please wait",
"buttons": [{
label: "✘ Understand",
primary: true
}],
"backdrop": "static",
"keyboard": false
});
}
I have tried this below code but its not working
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
spModal.open({
"title": "Tax Validation",
"message": "Validation is Inprogress, Please wait",
"buttons": [{
label: "✘ Understand",
primary: true
}],
"backdrop": "static",
"keyboard": false
});
setTimeout(function(spModal) {
spModal.close();
}, 500);
}
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 08:54 PM
Try this
spModal.open({
"title": "Tax Validation",
"message": "Validation is Inprogress, Please wait",
"buttons": [{
label: "✘ Understand",
primary: true
}],
"backdrop": "static",
"keyboard": false
})
.then(function() {
setTimeout(function() {
spModal.close();
}, 500);
})
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2022 10:50 PM
Hi,
I tried your code the popup is coming but its not closing automatically.