Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Integer validation - allows character sandbox only

[FIXED] Integer validation - allows character sandbox only 27 Sep 2012 09:16 #4056

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi again
I have a standard integer field - using the predefined integer validation

Downloaded component - is OK
- have tested download on local site (last nights build)
t999999 will show a validation error as expected

In the sandbox
- t999999 will pass validation in the sand box only
- ttt999999 But will fail validation as expected

Have a great day
The administrator has disabled public write access.

Re: Integer validation - allows character sandbox only 27 Sep 2012 09:28 #4059

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
At the begining regex are really fun, Now I am bored.

Well, this is a really simple regex.
There is absolutly no reason why it behaves different in sandbox for PHP.

There are 2 validations (JS, PHP)
I guess it is the JS validation that fails, because PHP is impossible.

Will check.

Thnks.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Integer validation - allows character sandbox only 27 Sep 2012 10:32 #4066

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
JS in sandbox definitely i had not saved the record
The administrator has disabled public write access.

Re: Integer validation - allows character sandbox only 27 Sep 2012 12:22 #4075

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Is this the same project with the checkout issue?

V2.0 etc?

The only time I've experienced similar issues was in a project where I'd switched to V2.0 beta and MooTools->JQuery on an existing project.

If this is the same project as your other issue it is quite likely that both symptoms caused by one issue - JS.

Gez
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.

Re: Integer validation - allows character sandbox only 27 Sep 2012 14:31 #4095

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
audibleid wrote:
Is this the same project with the checkout issue?
NO not same project (thanks anyway)

@ admin i have built a test project "test validations" that shows this issue

Does not work (2.5 build)
test value = t999999
- no JS Incorrect Value Prompt when exiting field
- "t" is stripped on save (php)

CONFIG SETTINGS => Jquery - condensed - jdom complete - table

BUT it works with the following config (2.5 build)
test value = t999999
- i do get the JS Incorrect Value Prompt when exiting field
CONFIG SETTINGS => moo tools - condensed - reduced - model

Thanks
Last Edit: 27 Sep 2012 16:04 by BTB300.
The administrator has disabled public write access.

Re: Integer validation - allows character sandbox only 27 Sep 2012 14:49 #4096

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Sorry if you've already mentioned this but, are you wanting it to fail validation if anything other than a digit or digits are present in the input?

If that is the case why not try using a custom validation something like;
^\d*$
?

You could add more conditions to it to set lower and upper length vals like {10,100} if you say wanted at least ten digits but no more than 100 digits...
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.

Re: Integer validation - allows character sandbox only 27 Sep 2012 15:58 #4098

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Sorry if you've already mentioned this but, are you wanting it to fail validation if anything other than a digit or digits are present in the input?

I found this purely by mistake when testing redierctions and went "that's a " t " in there it should have failed" then tested the validation further to be able to produce the details for the ticket

Yes in short - i simply want the value to only be an integer for an integer field

I can confirm that under specific config setting (listed above) that it does allow only integer values as expected
but also found that under other config settings it will allow t999999 but not tt99999

thank you for you suggestion will take it on board as part of the work around

For any one looking to take your advice above I also suggest that the field needs to be limited in length relative to the allowed size of the database field type as well to prevent issues as you have already suggested thank you
Last Edit: 27 Sep 2012 16:19 by BTB300.
The administrator has disabled public write access.

Re: Integer validation - allows character sandbox only 03 Oct 2012 13:01 #4225

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This is because the default regex furnished by Cook is wrong.
Fixed now.

TODO :
On the combo of the predefined regex, choose another one, then reselect the 'numeric' regex.
The regex is now poulated with the good one.
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: BTB300
Time to create page: 0.069 seconds

Get Started