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.320 seconds

Just wanted to congratulate you on the J-Cook website / web development tool. In a couple of visits I've had a play around with Cook and have to say I think it is fantastic.  I've played with a number of component builders in the past and yours is certainly looking like the best so far. I'd also like to help you spread the word - I'm really surprised more people aren't excited about this tool. Good luck with the project.
Dean

Get Started