Skip to Content
2
Former Member
Nov 19, 2012 at 03:59 AM

Validate alphanumeric field with no special characters:

6097 Views

Hi Experts,

I have a 10 character field on screen for user i/p which i need to validate such that it should be only alphanumeric characters

and it should not contain any special character.

I do this i have following in mind but looking for a better solution:

1.Check if i/p is alphanumeric:

if field CO syabcde ->only alphabets,

if field CO '0123456789'->only numbers

if field CA ~!@#$%^&*()_+{}|:"<>?/.,';][' ->special characters

2.To find a REGEX to do this. I tried couple of them which i found over internet but doesnt work.

Do we have a better way to do this ?

Experts please suggest