- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 06:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 07:27 AM
Trace issue to g:dialog_buttons_ok_cancel having extra attributes, e.g. 'ok_type=button'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 06:05 AM
can you add more details about your requirement ?
if possible add some example and screenshot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 06:30 AM
Here's the code.
It only works correctly in IE and does not work in firefox, chrome or edge. On submit does not trigger the processing script.
It was created several years ago and stopped functioning with our upgrade to New York
HTML
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g2:evaluate var="jvar_jobname">
var jobname = RP.getParameterValue('sysparm_jobname');
jobname;
</g2:evaluate>
<g:ui_form>
<form id="mytest" name="mytest" method="post">
<table width="100%">
<tr><td/><td/></tr>
<g:evaluate>
var title = "${RP.getWindowProperties().get('title')}";
title = new GlideStringUtil().unEscapeHTML(title);
</g:evaluate>
<tr>
<td nowrap="true"><g:no_escape>${title}</g:no_escape></td>
</tr>
<tr><td/><br/><td/></tr>
<tr>
<td colspan="2" align="right">
<g:dialog_buttons_ok_cancel
ok="invokeSubmitCall('ok');"
ok_type="button"
cancel="invokeSubmitCall('cancel')"
cancel_type="button" />
</td>
</tr>
</table>
<input type="HIDDEN" name="jobname" id="jobname" value="$[jvar_jobname]" />
<button type="SUBMIT" id="submitform" name="SubmitForm" value="Submit" style="display: none" />
</form>
</g:ui_form>
Client script
function invokeSubmitCall(type) {
var gdw = GlideDialogWindow.get();
var nameofjob = gel('jobname');
if (type == 'ok') {
gel("submitform").click();
window.location = window.location;
GlideUI.get().display({text:'Load for '+nameofjob.value+' Successfully Submitted!',type:'',sticky:false,closeDelay:5000,bundleMessages:false});
}
gdw.destroy();
return false;
}
Processing script
//Execute a scheduled script job
/ for tersting
gs.log("BOOM TESTING ASN LOAD Fired");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 08:15 AM
Your best bet is to set a value on a hidden input field in the HTML section to submit (for example) from the Client Script section and let the Processing script do the work. This is supported in all browsers and ServiceNow have been doing it this way for many, many years.
Hope that helps

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-27-2020 08:40 AM
this should work. are you getting any error in console?