- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2022 11:43 PM
While clicking the button a confirmation alert box should be displayed with text "the form is being submitted" with 2 options yes and no. when yes is selected form should be submitted and when no is selected it should not be submitted and should remain in the same page. Can anyone help me with this functionality.
Solved! Go to Solution.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:29 AM
Hii
In the UI Action change the server side code as per your requirement
Also attached the screen short below that will help you more
Here is the code for confirmation alert:-
function UpdatePdemo(){
var answer = confirm("are you sure wants to update the priority to 1-cretical");
if(answer == true){
gsftSubmit(null,g_form.getFormElement(),'sys_update_value');
}else{
return false;
}
}
if(typeof window == 'undefined')
priorityUpdate();
function priorityUpdate(){
current.impact = '1';
current.urgency = '1';
current.update();
action.setRedirectURL(current);
}
Regards,
Imran Ahmad
Please mark the response as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:07 AM
Hi Ankur,
Can you please explain about Confirm javascript prompt in detail
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:32 AM
Please share your existing script
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:29 AM
Hii
In the UI Action change the server side code as per your requirement
Also attached the screen short below that will help you more
Here is the code for confirmation alert:-
function UpdatePdemo(){
var answer = confirm("are you sure wants to update the priority to 1-cretical");
if(answer == true){
gsftSubmit(null,g_form.getFormElement(),'sys_update_value');
}else{
return false;
}
}
if(typeof window == 'undefined')
priorityUpdate();
function priorityUpdate(){
current.impact = '1';
current.urgency = '1';
current.update();
action.setRedirectURL(current);
}
Regards,
Imran Ahmad
Please mark the response as Helpful/Correct, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2024 12:20 PM
can you please explain the "
gsftSubmit(null,g_form.getFormElement(),'sys_update_value');
" Specifically the last part??
I am attempting to repurpose this to provide a prompt/confirmation before another function as youll see in the script below. The goal is to have the user confirm the state change before it happens. I would appreciate any help you could provide.