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

SOLVED

Text validation

Avatar

Level 1

I have an interactive on line form.  I am trying to lock down a text field to Alph only.  Where do I find this option.

1 Accepted Solution

Avatar

Correct answer by
Level 10

The following client-side JavaScript, attached to a text field exit event, will validate the characters a-z (ignoring case).

// form1.page1.subform1.firstName::exit - (JavaScript, client)

var regExp = /[^a-z]/i;
if (regExp.test(this.rawValue)) {
    xfa.host.messageBox("First name can contain the characters a-z, only.");
}

Steve

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

The following client-side JavaScript, attached to a text field exit event, will validate the characters a-z (ignoring case).

// form1.page1.subform1.firstName::exit - (JavaScript, client)

var regExp = /[^a-z]/i;
if (regExp.test(this.rawValue)) {
    xfa.host.messageBox("First name can contain the characters a-z, only.");
}

Steve