Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Numeric Validation -Fails Integer [2.5 BETA TESTS]

Numeric Validation -Fails Integer [2.5 BETA TESTS] 21 Jun 2013 16:55 #7593

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Searched for this one but could only find posts from 6 -7 months ago (sorry if it is already a known issue in 2.5 beta)

Today I created an integer field and set the properties as follows
- required -> yes
- unique -> no
- default value -> 365
- prefills form -> yes

validator -> numeric (set by default when field created)

in the validation test box any integer such as 2011, 365, 35465... fails validation

also fails in downloaded component
The administrator has disabled public write access.

Numeric Validation -Fails Integer [2.5 BETA TESTS] 21 Jun 2013 18:19 #7596

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
After some trouble shooting - rule names miss matched perhaps?

an integer value lets say 2...

Fails
numeric
positive integer

passes
decimal
positive decimal
percentage

A decimal value lets say 2.0 or 2.00

passes
percentage rule only

fails
All other predefined number validation rules

Hope the above information helps to find the resolution
Last Edit: 21 Jun 2013 18:21 by BTB300.
The administrator has disabled public write access.

Numeric Validation -Fails Integer [2.5 BETA TESTS] 23 Jun 2013 21:43 #7619

  • Tomaselli
  • Tomaselli's Avatar
  • Online
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
Hi,
I had the same experience, the numeric regex has an unexpected behaviour (in my opinion).
I thought it should allow any integer positive or negative, but I was wrong. it works only with a numeric range between -9 and 9.
I think this should be changed, also because this validation is used on the ordering field, so when the list becomes higher then 1 digit (for example: 10), the validation give a false error in the form.

I fixed it, using this regex pattern: ^-{0,1}\d+$
The administrator has disabled public write access.
The following user(s) said Thank You: admin
Time to create page: 0.074 seconds

Get Started