I would like to define a maskRe in javascript that only allows values from 0.002 – 0.1 to be entered in a form, any ideas?
James
On top of this, I would like to create a regex in javascript that only allows values from 0 – 50.00 to be entered in a form, any ideas?
Please understand that maskRe should be used to filter out invalid symbols – but not to validate value of an input:
regexproperty should be used for this.You can use both, though:
… or …
… if you don’t need to limit number of digits after the decimal point to three.
UPDATE: for 0 – 50.00 it would be something like this, perhaps…