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

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started