Form Validation

They have: 39 posts

Joined: Jun 2000

Is it possible to force users to enter only numeric or only alpha values in a text field?

Also is it possible to force users to enter data in a specific format i.e. AAA-999

A means alpha and 9 means numeric values

Thanks!

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

The answer is yes. For an example, see the Masking scripts at my site (phone, social security, etc)

Vinny

They have: 39 posts

Joined: Jun 2000

Thanks for the tip, but I need a script which checks that user is entring three letters and then three dash(-) and then three numbers i.e. ABF-963

They have: 39 posts

Joined: Jun 2000

Thanks, I got it working.

They have: 231 posts

Joined: Feb 2000

You could always try using 2 separate form fields - one form the alpha and the other for the numeric. It is very easy to check form data validation with JavaScript. If you need more help I can post more.

:: Lloyd Hassell :: http://www14.brinkster.com/lloydh ::

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.