Welcome, Guest
Username: Password: Remember me

TOPIC: VALIDATE ALPHANUMERIC UPPERCASE+LIMIT LENGTH

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

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 68
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!!!
The administrator has disabled public write access.
Time to create page: 0.052 seconds

Get Started