- 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:47 AM
"Not waiting to press ok" - Are you using this in an onSubmit catalog client script and wanting to use the ok button to complete the submission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2022 04:53 AM
You got it right it is written on onSubmit script but i am not expecting it to be like complete the submission.
So based on the validation i am posting a message and want users to read it so thought of using spModal which is working but it is not waiting so for workaround i am using alert method

- 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();
}
}
});
}