- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:47 AM
Hi, I put a glidemodal (glide_prompt) on a onsubmit client script. it shows up for a split second but then disappears. Anyone knows why its doing this? I will like to stay on the screen until the user hits submit or cancel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 11:03 AM
function onSubmit() {
var rfc = g_form.getValue('rfc');
var ga = new GlideAjax('RFCutil');
ga.addParam('sysparm_name', 'getRFC');
ga.addParam('sysparm_rfc', rfc);
ga.getXML(ManagerParse);
return false;
function ManagerParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var dialog = new GlideModal('glide_prompt', true, 600);
dialog.setTitle("testing");
dialog.setPreference("onPromptComplete", function(value){
g_form.setvalue("work_notes", "testing");
});
dialog.setPreference("onPromptCancel", function(value){
dialog.destroy();
});
dialog.render();
}
}
Hi @mmaraj
Try this
Regards
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 05:52 AM
Hi @mmaraj ,
share your client script
you have to put return false otherwise the form will reload
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 07:04 AM
since it's onSubmit it will show the modal and submit the form
You should use return false to stop the form submission
Please share your business requirement
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
06-25-2025 10:57 AM
this is the code snippet I;ve been trying. I added return false...but the dialog is still disappearing
function onSubmit() {
var rfc = g_form.getValue('rfc');
var ga = new GlideAjax('RFCutil');
ga.addParam('sysparm_name', 'getRFC');
ga.addParam('sysparm_rfc', rfc);
ga.getXML(ManagerParse);
function ManagerParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var dialog = new GlideModal('glide_prompt', true, 600);
dialog.setTitle("testing");
dialog.setPreference("onPromptComplete", function(value){
g_form.setvalue("work_notes", "testing");
});
dialog.setPreference("onPromptCancel", function(value){
dialog.destroy();
});
dialog.render();
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2025 11:03 AM
function onSubmit() {
var rfc = g_form.getValue('rfc');
var ga = new GlideAjax('RFCutil');
ga.addParam('sysparm_name', 'getRFC');
ga.addParam('sysparm_rfc', rfc);
ga.getXML(ManagerParse);
return false;
function ManagerParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
var dialog = new GlideModal('glide_prompt', true, 600);
dialog.setTitle("testing");
dialog.setPreference("onPromptComplete", function(value){
g_form.setvalue("work_notes", "testing");
});
dialog.setPreference("onPromptCancel", function(value){
dialog.destroy();
});
dialog.render();
}
}
Hi @mmaraj
Try this
Regards
Chaitanya