- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 04:17 AM
Hi,
I am using spModal.alert to pop-up a message which is working fine but the browser is not waiting to press Ok just like how alert method stops the submission.
Is there a way we can stop using spModal.alert
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 11:02 PM
You can use something like the below, the "_hasConfirmed" value is added onto the g_form object to determine whether the user has gone through the process of accepting the prompt.
if(g_form._hasConfirmed == "undefined"){
g_form._hasConfirmed == false;
spModal.alert("Message here").then(function(answer){
if(answer){
g_form._hasConfirmed = true;
if (typeof g_form.orderNow != 'undefined') {
g_form.orderNow();
} else {
g_form.submit();
}
}
});
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 04:33 AM
Hi,
Can you please share Client controller script and how you are using it?
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 04:38 AM
I am using a Catalog Client Script:
spModal.alert('Thank you for submission!');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 04:42 AM
Hi,
Please check the documentation.
You need to use it like below:
spModal.alert('Thank you for submission!').then(function (answer) {
//do nothing or write some code if needed
});
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 05:41 AM