Place holder text

brendanwilson84
Kilo Guru

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.";

}

find_real_file.png

However, we are now using service portal and the form widget to create records etc and this does not come over

find_real_file.png

Can this be done?

1 ACCEPTED SOLUTION

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


View solution in original post

16 REPLIES 16

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


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


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 ?


brendanwilson84
Kilo Guru

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");


}