The CreatorCon Call for Content is officially open! Get started here.

How to remove the white spaces of the value and show it at the same time.

VIKAS MISHRA
Tera Contributor

We have created one UI page as mentioned in below screenshot, as per our configuration if user enters a value in field   "T

As per my requirement is users put the value in first field with some extra spaces such as "    Test" and then clicks on submit but he will get error but it keep shows the value as "     Test" , However it should show like "Test" i mean it should remove the extra space at the same time.

 

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

I doubt you can do that at same time. you can write onChange event on that text input and trim the whitespaces which are leading or trailing

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

OnChange Event means you are talking about onChange client script.?

Nope; since it's an UI page you will have to use onChange event

onChange client script won't work right since it's not a form

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader