- 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-15-2022 11:52 PM
Hi Maradani,
Please create one onSubmit Client script and try the below code.
function onSubmit() {
//Type appropriate comment here, and begin script below
var msg = "The form is being submitted"
return confirm(msg);
}
Please mark the response as Helpful/Correct, if applicable. Thanks!
Thanks,
Nikita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2022 11:59 PM
i need 2 options yes and no as well. can you please tell how can I achieve it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-16-2022 12:01 AM
Hi,
you can use Confirm javascript prompt which has OK and Cancel
For creating with Yes or No you would require UI page
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader