Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Character Counter for multi line text variable in Service catalog - on service portal

Sai Kumar P
Tera Guru
Tera Guru

Hi, Need a real time character counter for a multi line text variable. this should be set to only for a particular catalog item. Searched in community, not much of help
thanks in advance
@Chuck Tomasi 

5 REPLIES 5

DUGGI
Giga Guru

@Sai Kumar P  try the below script, just an idea.

 

function onLoad() {
  // Replace "text_area" with the ID of the multi line text variable
  var element = gel('text_area');

  // Add an event listener to the element to update the counter in real-time
  element.addEventListener('input', function() {
    var remainingChars = 200 - element.value.length;

    // Replace "char_count" with the ID of the HTML element that displays the character count
    gel('char_count').innerHTML = remainingChars + " characters remaining";
  });
} 

 

@Sai Kumar P  can you help me please.iam unable to implement this.

Hi @Vinya Jakkula @Sai Kumar P 

try this:
https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/reference-pa...

-----------------------------------------------------------------------------------

Please consider marking my reply as Helpful 👍 and/or Accept Solution ✔️, if applicable. Thanks!

 

Hi @Satishkumar B  it will applicable only on forms like problem , change, incident like backend.but I required on catalog forms variables which is multiple line text.