Page 1 of 1

How do you format the name ?

Posted: Wed Dec 01, 2021 11:43 pm
by yvesf
I would be interested to format the name with the first letter in uppercase and the other letters in normal : how can you do that in nuBuilder ? More generally how do you format text ? Many thanks for your help.

Re: How do you format the name ?

Posted: Thu Dec 02, 2021 5:39 am
by kev1n
Hi,

To make the first letter of a text object uppercase:

Code: Select all

nuSetValue('your_object_id_here',nuGetValue('your_object_id_here').capitalise());
In general, there are a lot of functions and methods to format text. It very much depends on your needs what to use.

To format the text when a (text) input object looses focus, add an onblur event to the object with a code like

Code: Select all

nuSetValue(this.id,nuGetValue(this.id).capitalise());

E.g. see here.

https://developer.mozilla.org/en-US/doc ... formatting
https://developer.mozilla.org/en-US/doc ... xpressions

Re: How do you format the name ?

Posted: Mon Dec 06, 2021 1:25 pm
by kev1n
Hi Yves,

Did that help you to achieve your goal or do you need additional information?