- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 02:59 AM
Hi Guys
We have a client script for place holder text which works fine on back end form, naive UI.
function onLoad() {
//Type appropriate comment here, and begin script below
var eta= g_form.getControl('u_eventname');
eta.placeholder = "test.";
}
However, we are now using service portal and the form widget to create records etc and this does not come over
Can this be done?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 03:12 AM
I guess the g_form.getControl() method is not supported by Service Portal
You can check this link which shows the client side API's which can be used in Service Portal.
It does not contain that method
Service Portal and client scripts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 03:12 AM
I guess the g_form.getControl() method is not supported by Service Portal
You can check this link which shows the client side API's which can be used in Service Portal.
It does not contain that method
Service Portal and client scripts

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 03:19 AM
Instead of getControl() you can try using g_form.hasField()
Check this posts for more help
g_form.getControl() not working in Service Portal in Catalog Client Script
g_form.getControl not working in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 03:26 AM
thanks aakash
I guess its the placeholder is the issue
function onLoad() {
//Type appropriate comment here, and begin script below
var eta= g_form.hasField('u_eventname');
alert('test');
eta.placeholder = "test.";
}
I do get the pop of alert in portal using g_form.hasField

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 03:31 AM
Hi,
As Saprem rightly said, this feature is available with Jakarta.
How to add the HTML5 placeholder attribute to a Service Catalog Item variable \
Is your instance on Jakarta Release ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2017 03:37 AM
Instance is on Jarkarta, but this feature is only available on record producers and not normal fields on forms.
I love the idea of placeholder, but found i can use decoration and comes into form widget portal
function onLoad() {
//Type appropriate comment here, and begin script below
g_form.addDecoration("name field", "fa fa-question-circle", "This works");
}