- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 03:32 PM
I have a UI Page that prompts a window with a few fields to a user, and when they enter a specific field I want to select or deselect a checkbox on the prompt from the Client Script. I've attempt different code to accomplish this but haven't succeeded so far. Below is the HTML code for the checkbox:
<tr id="standardrow">
<td><label for="standard">Standard?</label></td>
<td><g2:ui_checkbox id="standard" name="standard" value="false" /></td>
</tr>
Here is the Client Script code to set the "Standard" checkbox on:
gel('standard').checked = true; //doesn't check prompt checkbox
I have a quantity field on the prompt and code gel('myquantity').value = '9'; does set the filed to "9". What is my code missing to set the checkbox?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 07:13 PM
Hi dfe,
Please use this:
gel("ni.standard").checked = true;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
DXC Consultant.
Cuong Phan
ServiceNow Technical Lead

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2020 07:13 PM
Hi dfe,
Please use this:
gel("ni.standard").checked = true;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Cuong Phan
DXC Consultant.
Cuong Phan
ServiceNow Technical Lead
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2021 09:06 PM
Hello,
Can someone please help? I have been searching on the web for many days, but I have no luck of finding an example of the below request.
I need a button on the incident form. When a user click on the button, a popup window with 4 checkboxes and a OK and Cancel buttons. If a user select one or all checkboxes, then click on the OK button. The select checkboxes information will populated in either the comment or work notes field on an incident form. If a user click on a cancel button, then it will close the popup window.
Thank you in advance