[eluser]theshiftexchange[/eluser]
I've tried searching on these forums & googling with no luck:
Does anyone have a _callback_function for currency form validation? Basically I want to allow:
- $ (first symbol only, but NOT required)
- number >= 0 (i.e. no negative)
- optional decimial point
- 0-2 decimal places (if decimial point was used)
I'm NOT interested in allowing commas, such as "$1,249.50" - but that is a bonus if it accepts it.
I'm thinking I could do a function to check for all this - but I'm guessing a Preg_check() would be better - I'm just not sure how to do it?