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.

replacing ENTER key stroke value with space in a String

balaram
Mega Contributor

how can we replace ENTER key stroke value with space in String ?

1 ACCEPTED SOLUTION

veena_kvkk88
Mega Guru

Hi Balaram,



You could do that in a client script.



Eg: onChange client script on 'u_test' field.



var text = newValue.replace(/\n/g, ' '); //replaces newlines with spaces


g_form.setValue('u_test', text);


View solution in original post

1 REPLY 1

veena_kvkk88
Mega Guru

Hi Balaram,



You could do that in a client script.



Eg: onChange client script on 'u_test' field.



var text = newValue.replace(/\n/g, ' '); //replaces newlines with spaces


g_form.setValue('u_test', text);