I need an input field that matches the following criteria, I have looked at input masks but can't seem to find one that fits my needs! Any pointers would be much appreciated!
The field is for submitting a currency in whole numbers. I would like commas added in as the user is typing (or for it to accept properly placed commas) eg. 1,000,000, 1,000 etc.
It also needs to either not allow decimal places or automatically add .00 to the end.
Then when the PHP form is posted it needs to post only the whole number (or with the .00 on the end is fine!).
Does anybody have an idea how I could achieve this? Live validation would be best rather than waiting until submit. :)
There is server checks for the correct format so don't need to worry much about somebody without JS submitting bad input.
I have tried HTML5 number input with step as 1 but this still allows me to type decimals in and will even submit. I assume this is just for the arrows!