- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2025 10:25 PM - edited 03-04-2025 10:27 PM
Hi,
Is it possible to run a modal after submitting a form in custom workspace? Some Example script will help. Also is it possible to redirect user to some other page using the modal?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 12:55 AM
why not open that in new tab so that form gets saved and the tab is also opened?
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-04-2025 11:17 PM
yes you can use g_modal and show button and then redirect
but why not use confirm box and then redirect?
If my response helped please mark it correct and close the thread so that it benefits future readers.
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-05-2025 12:52 AM
Hi @Ankur Bawiskar ,
This is the script I used -
But I want the form to get saved first and then do the redirection. Is it possible to run the entire thing after saving form
function onSubmit() {
//Type appropriate comment here, and begin script below
var answer = confirm('Record saved successfully');
if (answer) {
var redirectURL = 'https://www.google.com/'; //url to redirect; this approach works in platform and Service Portal view
top.window.location = redirectURL;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 12:55 AM
why not open that in new tab so that form gets saved and the tab is also opened?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader