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

TOPIC:

Regular expression problem 25 Feb 2012 21:29 #1447

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
This is my regex : ^((0[0-9])|(1[0-9])|(2[0-3]))$
Quite simple, i use it to validate an hour field. Correct values are 00 to 23, with two figures everytime, even is hour < 10.
When I use this regex, it validates when i fill the fields in form view, but i use a number like 07, then it gives me an error on "save". So i have a green checkmark, but saves are not saved.
Any idea why this doesn't work ?
Thanks,

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

Re: Regular expression problem 27 Feb 2012 13:37 #1465

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Did you modified the RegEx after Cook generation ?

Because Cook Self Service write this RegEx in two different languages.
- In javascript (JDom script) -> Determines the green tick or not before to submit the form.
- In Php (in the table file : tables/mytable.php)

If you get the error on save(), you should have a look in the check() function of your table.php

Can you confirm you are looking in the table validation (check() method) ?

After that, watch carefully what string you furnish to the JDate() class.

That's all. If both points are corrects, it works.
Coding is now a piece of cake

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

Last edit: by admin.

Re: Regular expression problem 27 Feb 2012 17:54 #1471

  • VeCrea
  • VeCrea's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
Thx for your answer.
No i did not modify RegEx after generation.
Do i still have to check the rest ?
^((0[0-9])|(1[0-9])|(2[0-3]))$ this won't work
^([0-9]|(1[0-9])|(2[0-3]))$ this works

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

  • Page:
  • 1
Time to create page: 0.083 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