Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Set a Limit in Using a Comb in a Text Field

Avatar

Level 4

I have a Text Field that has a Comb of 6 characters. The uses should input either a 5 or 6 characters in this field. Is there a way to give an error message if the user does not input at least 5 characters?

Thanks for you assistance,

Parre

1 Accepted Solution

Avatar

Correct answer by
Level 10

Try this code in the Exit event of the field with JavaScript as the language..

if(TextField1.rawValue.length<5){

xfa.host.messageBox("The field length should be minimum 5 characters");

xfa.host.setFocus(this);

}

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Try this code in the Exit event of the field with JavaScript as the language..

if(TextField1.rawValue.length<5){

xfa.host.messageBox("The field length should be minimum 5 characters");

xfa.host.setFocus(this);

}

Thanks

Srini

Avatar

Level 4

Thanks you once again. It worked.