The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How to add the HTML5 placeholder attribute to a Service Catalog Item variable

lasse3
Giga Guru

When exposing a request item in a service catalog on the service portal (Helsinki) it would be nice to be able to specify a placeholder tag on the HTML input field.

You can add hints and help text to the Service Portal using the "Instructions" field on the variable. However this only places the text above the input field and not as a placeholder.

Simplyfied what I would like to achive is to have Service Portal do this:

<input type="text" id="name" placeholder="Enter your name here" />

instead of this:

<p>Enter your name here</p> <input type="text" id="name" />

I know that this can be accomplished in the backend as discussed in this thread:

https://community.servicenow.com/thread/152916

This does however not seem to be compatible with the service portal and uses the g_form.getControl() which is deprecated for the mobile platform. Also it calls prototype using the $ object reference which is not supported in mobile scripts according to the wiki:

http://wiki.servicenow.com/index.php?title=Mobile_Client_GlideForm_(g_form)_Scripting

I figured that perhaps I could edit the sp-model in the angularjs part, but this seems to be hidden in the service-now core and is not accessible.  

Any input would be greatly appreciated.

1 ACCEPTED SOLUTION

shouvik
ServiceNow Employee
ServiceNow Employee

This is a feature coming in J release. Users will have configuration option to provide placeholder text(example text) for variables and will be supported both in platform and service portal.



Thanks


Shouvik


View solution in original post

6 REPLIES 6

Shiva Thomas
Kilo Sage

Hi Lasse,



In case that helps, I wrote an article about HTML Placeholders that applies for Platform and pre-Jakarta instances: Great UX Trick: HTML Placeholders


EdwinRandall
Tera Contributor

ink takes me nowhere