Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to add prefix to entere value?

aka44356106
Level 4
Level 4

Sir

in textfield display pattern any way to add a prefix in textfield

i try it

text{'Name' AAAAAAAAAAAAAAAAAA}

BUT when name in two words (e.g. Michal Shumakar) its not worked.

7 Replies
_Bruce_Robertson
Level 10
Level 10

The 'A' symbol will match alphabetic characters, which the space character is not.

You could try text{'Name ' XXXXXXXXXXXXXXX} which will work for "Michal Shumakar", 'X' matches any character, but will only match a 14 character value.

You probably want to try doing this in code.

aka44356106
Level 4
Level 4

any other way to add a prefix in a textfield at runtime.

aka44356106
Level 4
Level 4

WHEN I select email alphanumeric pattern  

its work fine when less than 14 characters text{OOOOOOOOOOOOOO'@example.com'}

but not working in case of   text{'Name ' XXXXXXXXXXXXXXX}

radzmar
Level 10
Level 10

You can create the pattern depending on the length of the input string dynamically.

Add this script to the fields exit event:

if (!this.isNull) {

    this.format.picture.value = "text{'Name '" + new Array(this.rawValue.length + 1).join("X") + "}";

}

aka44356106
Level 4
Level 4

any short script for this dispaly pattern

null{'Name :'}|text{'Name : 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' '}

radzmar
Level 10
Level 10

It's almost the same:

if (!this.isNull) {

    this.format.picture.value = "text{'Name: '" + new Array(this.rawValue.length + 1).join("X") + "}";

} else {

    this.format.picture.value = "null{'Name: '}";

}