- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 06:30 AM
Hello,
I am trying to add some a CSS header to a task form.
I have created a formatter and an UI macro.
I can get the CSS to work ....
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div class="jumbotron">
<h2>This CSS formatter</h2>
</div>
</j:jelly>
My question is for the next part is for the next part I want to display CSS formatted data but cant find info for how to put the syntax together
I assume its something like this but I who knows? Can I display variables ? Is there any resources I Cna look at of how I can add some CSS flare to change forms
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div class="jumbotron">
<script>
var chgNumber = g_form.getElement('number');
var chgtype = g_form.getElement('type');
</script>
//not sure w
<h2>The change numebr is ... $chgNumber </h2>
<h2>The change numebr is ... $chgtype </h2>
</div>
</j:jelly>
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2018 08:28 AM
Hi,
I think g_form wouldn't work on ui macro.
Follow below approach;
<h2 id ="message1"></h2>
<h2 id ="message2"></h2>
Write an onload client script.
document.getElementById("message1").innerHTML = g_form.getElement('number');
document.getElementById("message2").innerHTML = g_form.getElement('type');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2018 06:30 AM
Hi,
I am sorry, I mistakenly pasted g_form.getElement('number');.
Please do not use g_form.getElement('number').value; instead use g_form.getValue('number') as a art of best practice. Refer https://docs.servicenow.com/bundle/kingston-application-development/page/app-store/dev_portal/API_reference/GlideForm/concept/c_GlideFormAPI.html

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2022 01:39 PM