Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

How i access via script a single element from a textfield defined as Comb Of Characters?

Avatar

Level 1

How i access via script a single element from a textfield defined as Comb Of Characters?

3 Replies

Avatar

Level 10

You can use the charAt() method which returns a characters at the defined index position (index is 0-based).

var singleChar = Textfield.rawValue.charAt(2); // returns the 3rd character

Avatar

Level 1

hi, thanks for answer, but didn't work! I got a errorCapturar.PNG

this the code:

var teste = Campotexto3.rawValue.charAt(2)

$host.messageBox(teste)

Avatar

Level 10

You have to select JavaScript as language in the script editor!