Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[FIXED] number filtering broken for form input
07-23-2013, 12:13 PM (This post was last modified: 07-23-2013 12:16 PM by phil.)
Post: #11
RE: [FIXED] number filtering broken for form input
Perhaps such a regex should be encapsulated in a function in MiscFunctions.php function - that we should use instead of is_numeric(filter_number_format($MyNumber))

I am thinking though this is a bit over the top though, as if a user makes such a typo - it seems only reasonable to expect a strange result.
To interpret the number as though the comma was not entered - as a thousands separator in the wrong spot seems perfectly reasonable to me.

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
07-23-2013, 10:28 PM (This post was last modified: 07-23-2013 10:34 PM by icedlava.)
Post: #12
RE: [FIXED] number filtering broken for form input
Hi Exsonqu,
(07-23-2013 11:50 AM)Exsonqu_Qu Wrote:  I've checked the server side check. If we want to prevent this from input, a regex pattern should be defined at server side php scripts too just like the js doing in client side. Otherwise, we cannot sort this kind of errors out.

Yes, my initial impression was that we need some more planning for improved locale handling in general, and validations. Rather than patching perhaps we can look at developing a new approach?

Thank you for following up on the locale checking and replicating the issue.

Best,


Hi Phil,

(07-23-2013 12:13 PM)phil Wrote:  I am thinking though this is a bit over the top though, as if a user makes such a typo - it seems only reasonable to expect a strange result.
To interpret the number as though the comma was not entered - as a thousands separator in the wrong spot seems perfectly reasonable to me.
I would think any number not adhering to the locale input patterns would be flagged as error. In both the chinese and english locales, if for example a comma was entered in a decimal number, then that number should be flagged and input prevented until corrected - eg we only expect numbers and a decimal point (.) - no commas.

Data entry does not cater for thousand's separators here - this only should be used in display not in input fields.

Thanks for the opportunity to have input.

Cheers,
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)