Apr 18th, 2010, 5:20 PM
(Apr 18th, 2010, 4:59 PM)Ben Wrote:Quote:I want users to be able ti fill in any number with up to 4 digits or 3 digits with a comma as decinal separation.
Ah, okay! Hmm... try this instead:
Code:rules.push("reg_exp,aantal_groen,^\s*[0-9\\,]{3,4}\s*$,i,alleen cijfers en komma!");
The "[0-9\\,]" bit is a "character class". It matches any number, 0-9 and the comma (double escaped to make it work within the string). The {3,4} bit matches the preceding expression either 3 or 4 times.
I think that'll work...
- Ben
Hello Ben,
I am sorry to say that it still doesn't work.
I want my users to be able to fill in numbers as:
1
2
2,24
0,01
when I try these options it still gives me my errormessage: alleen cijfers en komma....
Thanks anyway for reviewing my 'beginners' question.....
I hope you still somehow find the energy to try to resolve mu problem.
If not I will have to revert to make it a drop down box with 0 | 0,25 | 0,50| etc.. I have tried all options even against your advice to double escape the comma...no solution yet.
I would be very happy if you could help me with it. No time to follow a programmers course...;-)
Greetings
Bert