- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 12:37 AM
Hi All
My script is
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">
<g:ui_form>
Number <g:ui_reference name="ritm" id="ritm" table="sc_req_item" completer="AJAXTableCompleter" />
User: <g:ui_reference name="user" id="user" table="sys_user" completer="AJAXTableCompleter"/>
</g:ui_form>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td align="left" nowrap="true"><br />
<g:dialog_buttons_ok_cancel ok="return validateForm()" cancel ="return OnCancel"/>
</td></tr>
</table>
</j:jelly>
Client script
function onCancel() {
var c = gel('cancelled');
c.value = "true";
GlideDialogWindow.get().destroy();
return false;
}
function validateForm() {
var x= gel("ritm").value;
var y= gel("user").value;
if (x== "" ||y=="") {
alert("Please provide data to submit the dialog.");
return false;
}
return true;
}
Ok and Cancel button dont work as expected.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 01:54 AM
Adding this in HTML made it work
<input type="hidden" id="cancelled" name="cancelled" value="false"/>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 12:49 AM
Hi Surya,
What error it gives? Did you try giving alert?
Is this custom UI page?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 01:03 AM
Hi Ankur,
Yes its a custom Ui page. I need two reference fields. Then On population i have a processing script to run. But I see Ok and cancel button dont operate.
Though the alert to check validateform works. I dont see the cancel and ok button disappear when clicked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 01:45 AM
Hi Surya,
So basically whatever user has entered in Number and User you need to fetch that in Processing script?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2020 01:54 AM
Adding this in HTML made it work
<input type="hidden" id="cancelled" name="cancelled" value="false"/>