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
BedrockMission!

Learn More

View all

Sign in to view all badges

Ensure input is all alpha characters?

Avatar

Avatar
Level 2
BJeppson
Level 2

Likes

0 likes

Total Posts

16 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
BJeppson
Level 2

Likes

0 likes

Total Posts

16 posts

Correct Reply

0 solutions
View profile
BJeppson
Level 2

29-06-2008

My form has some fields that should only have alphbetic characters--no numbers or symbols--but the lengths will vary from a couple of letters to an entire sentence. For example, entering a bunch of cities and counties and peoples' names. The length varies, but all must be alpha characters only.



Thanks.



Buck

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

30-06-2008

On the exit event of the field you want to effect you can run a javascript command to force th etyped in input to Upper case. I believe the command is toUpper().

Avatar

23-09-2008

Hi Paul,



Can u explain the same.

I have taken text field;it takes numerics,symbols as well as alphabets.

How can we validate that the field consists of alphabet only? How the scripting can be done?



i didnt get the use of toupper(),how it will ensure the field consists of only alpha characters.



Thanks



Buddy

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

23-09-2008

The toUpper() is a javascript command that can be applied to a string that woudl return all chars in upper case. If you want to restrict to alpha only then having a mask of text{AAAA} forces a 4 char alpha input. If the number of chars is unknown then you will have to test each char as it is entered. I have script somewhere for this so if you need it let me know.

Avatar

23-09-2008

Hi Paul,



The number of characters is unknown,i need to validate fields like customer name.

I have tried with text{AAA}.But it works only for word length of 3.I need to check for variable length field. Please provide me with the Script.It will be a great help.



Thanks,

Buddy

Avatar

23-09-2008

Hi Paul,

I have one more question.

For better Performance which one is better for a large sized file

1)validation

2)scripting



For variable length character validation is Scripting the only option?



Thanks,

Buddy

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

24-09-2008

If you do not know the length the scripting is your only choice.

Avatar

26-09-2008

You could use a regular expression in the exit event (using JavaScript). The following will return true if the user has entered any combination of spaces and letters (including an entry consisting of all spaces - you may want to handle that scenario as well):



if (!this.rawValue.match(/^[\sA-Za-z]+$/)){

// Handle the error as desired here

}



To learn more about RegExp, check out this tutorial:

http://www.regular-expressions.info/tutorial.html