Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

VALIDATE ALPHANUMERIC UPPERCASE+LIMIT LENGTH 16 Oct 2012 23:07 #4603

  • JoomGuy
  • JoomGuy's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
OK, say you want need an alphanumeric field for something like a product code, grab yourself a string datatype and add a regular expression similar to;
^[A-Z0-9]{2,10}$
In this particular example,
  1. [A-Z0-9] allows only UPPERCASE letters from A-Z OR numeric values between 0 and 9
  2. {2,10} length is restricted to a minimum of 2 and maximum of 10
Valid
  1. 12345ABCDE
  2. M12
  3. SHOES115
  4. F1DEF

Invalid
  1. 12345ABCDEF
  2. M
  3. 9
  4. f1def
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.053 seconds

The j-cook project is one of the best of its kind and it is nice that we all try to contribute in little ways to make life easy for each other.

vlemos (Forum)  

Get Started