numerical validator with comma

hi everyone,

i want to validate my nulerical attribute with comma.

i tried to do like that :


 

array('number_value', 'numerical', 'integerOnly'=>FALSE,'integerPattern'=>'/^\s*[-+]?[0-9]*\,?[0-9]+([eE][-+]?[0-9]+)?\s*$/','message'=>'erroreeeeee'),



but nothing happened

what is the solution so numerical validator works with comma not with dot ?

i mean that he will be able to validate 12,12 instead of 12.12

Just use "numberPattern" instead of "integerPattern"

We can also use like this -


array('number_value', 'match', 'pattern'=>'/^[0-9]+$/', 'message'=>"{attribute} no. Invalid."),

use @ereg_replace pattern ‘^,[0-9]’,

This will validate any comma separated integer list

array(‘number_value’, ‘match’, ‘pattern’=>’/^[0-9]+(,[0-9]+)*$/’, ‘message’=>"{attribute} no. Invalid."),