Commas in HTML INPUT textfields for better readability
Sometimes, when a user enters numbers into a HTML INPUT text field, he/she enters commas too for readability esp in the case of financial inputs.
But when we send the input data via a form to the backend script for storing into a database, say MySQL database, we don't want the commas in the SQL INSERT statement.
So here's a script to show the commas while typing and remove the commas on hitting the submit button.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyxMF4mVA_JUAVSVzZWE3L2VpDVOqeH0tXofeb6jlHUe2B8tyXgevn7wjWoVpnLqkQPtC39BA_l9NhXlOY-Z0WtNGWLVV82jfDyGmZzW-9GGhoWGIuumIcAzXmvAdkQOowK7Va71M4GA0/s1600/commas.png)
HTML, JavaScript | Sunday, April 28, 2019 |
0 comments:
Post a Comment