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

TOPIC: [SOLVED] qv:custom rule not found - decimal_comma

[SOLVED] qv:custom rule not found - decimal_comma 18 Nov 2012 11:15 #5441

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Hi,

When setting the Validator to Decimal (comma) see:



I get this error when running the component in the Sandbox:

jqv:custom rule not found - decimal_comma

Is this a bug?
Last Edit: 18 Nov 2012 11:16 by goslingcools.
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 11:25 #5442

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
When setting a decimal field, you must provide it with both precision and scale properties...

Precision = the max total digit length
Scale = the number of digits past the point

Hope this helps!

Gez

P.S. Another user was having different issues with decimal validation... If the above results in different error, please see this thread and the linked thread from my post in it: www.j-cook.pro/forum/19-new-tickets/5437...not-found-decimal102
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: qv:custom rule not found - decimal_comma 18 Nov 2012 11:33 #5443

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Thanks for your quick reply.

But... after adding precision and scale it still gives this popup error. And after closing the error popup I also get the (php) error in the message area: Validation Rule missing: decimal_comma

What to do?

I use jQuery...
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 11:34 #5444

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Is this project in cook version 1.5 or 2?

***********ADD***********
Also, have you rebuilt your project? If not, try rebuilding files then sandbox it again.

I'll just add a decimal field to my project to check it out now - first without precision or scale...
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 18 Nov 2012 11:37 by JoomGuy. Reason: ADDED INFO
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 11:37 #5445

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
See Added in previous
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: qv:custom rule not found - decimal_comma 18 Nov 2012 11:38 #5446

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Do you mean Joomla! compatibility V2.0 Beta - Joomla 2.5 ?
The middle option...
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 11:48 #5447

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
I meant the COOK version not joomla but, it sounds like your using Cook 2.0b, right? That is the middle option...

I've never used the decimal (comma) field before but from looking at the regular expression, it's intention seems to be to format the decimal with a comma (,) instead of a full stop or period (.) right?

So, valid inputs would be
1,01
1000,99

Instead of 1.01
1000.99

Right?

Some users have said that the other main rule decimal(10,2) an some of the others don't work in COOK 2.0 however, this has not been my experience exactly. I have however opted to validate with a custom regex in a string field because of needing to be a bit more specific about acceptable values. For instance, the standard decimal fields allow entry of 0.00 or 0,00 (comma) which I needed to be invalid because I was dealing with price and length which in my case should never be free or = to zero.

Will get back to you on the results of my test in a couple of mins.

In the meantime, yoou may like to read that other thread I linked to.

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: qv:custom rule not found - decimal_comma 18 Nov 2012 12:00 #5448

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
OK, I got the same here too... Also, ignore what I said about the precision and scale! It does not get used in this rule in any case.

What are your requirements for this? I mean, what types of values should be accepted/rejected?

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: qv:custom rule not found - decimal_comma 18 Nov 2012 12:01 #5449

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
How to choose the Cook version? I thought it was related to the Joomla! compatibility option below Flush Dataset, the 3 options...?

With the middle option (2.0 beta) I get this error I mentioned before.

Now with the most left option in Joomla! compatibility I get no error at first.

When I enter 3,5 and click Save, it's validated ok and saved.
However when the form reloads after the save it shows 3.00
When I click Save again, I get a validtion error because 3.00 is not a comma format....?!
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 12:05 #5450

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
I want to enter Dutch values like 5,95
Of couse they are saved as 5.95 in the db (right?)
But when loaded into the form they should turn up as 5,95 again

I saw that it's already working fine with Dutch dates
Last Edit: 18 Nov 2012 12:06 by goslingcools.
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 12:12 #5451

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
goslingcools wrote:
How to choose the Cook version? I thought it was related to the Joomla! compatibility option below Flush Dataset, the 3 options...?
Yes, you're correct, it is that option...

Personally, I'd stick with the middle option (COOK v2.0b) as it won't be in beta for long.
goslingcools wrote:
Now with the most left option in Joomla! compatibility I get no error at first.

When I enter 3,5 and click Save, it's validated ok and saved.
However when the form reloads after the save it shows 3.00
When I click Save again, I get a validtion error because 3.00 is not a comma format....?!
goslingcools wrote:
I want to enter Dutch values like 5,95
Of couse they are saved as 5.95 in the db (right?)
But when loaded into the form they should turn up as 5,95 again

I saw that it's already working fine with Dutch dates
I think there are some issues between the client-side JS and PHP validations. It seems that no matter what, your data is getting saved with a '.' as opposed to ','.

I think a custom rule will be required here in any case as the standard rules are very generic to allow a wide variety of uses...

What type of data are you wishing to store - price, dimensions...?

Also, what are you wanting to validate/invalidate - what is accepted and not accepted?
What is the lowest + highest values that are acceptable?
What's the most/least number of commas accepted?
How many digits should be contained maximum/minimum?

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 18 Nov 2012 12:12 by JoomGuy.
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 12:20 #5452

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Thanks again,

The only thing I want to achieve is:

Entering values with comma's instead of dots.

The validation should be like a normal decimal numer with 2 digits, only separated by a comma instead of a dot.

I want to use the field as a price field, but sometimes for sizes etc. But just always a comma instead of a dot

So yes a price format field and a dimension format field.

The price can be as big as they want, same for the dimension. I just want to replace the comma with the dot
Last Edit: 18 Nov 2012 12:24 by goslingcools.
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 12:23 #5453

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
So for instance, would the following be acceptable:
0,0
00,1
00,01
0,0,1
10
10,001
100,1
10000,01
?
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: qv:custom rule not found - decimal_comma 18 Nov 2012 12:24 #5454

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Yes those would be fine
The administrator has disabled public write access.

Re: qv:custom rule not found - decimal_comma 18 Nov 2012 12:25 #5455

  • goslingcools
  • goslingcools's Avatar
  • Offline
  • Senior Member
  • Posts: 64
  • Thank you received: 7
  • Karma: 1
Nope :-)

0,0,1 is NOT allowed, just 1 comma
just like a normal number, only the dot replaced with a comma
Last Edit: 18 Nov 2012 12:26 by goslingcools.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.146 seconds

Get Started