I wanted to know if there is a way to add a comma into an input field that all numbers which has a php validation check for numbers and then checks the string length.
say I want min 6 numbers, max 8 numbers, php validates it, checks strong length,then adds in a comma in the thousand area on the form and when it posts too.
Or can only js do this? IF so, how would that work if PHP is validating and then the js is adding a comma?
and store it in the database without commas.When you want to display it to the user with commas then use “number_format” as told by “Force Flow” above.