Is it possible to block commas from being entered in a field

By: Ken Scherer | Asked: 12/06/2022
ForumsCategory: General questionsIs it possible to block commas from being entered in a field
Ken SchererKen Scherer asked 1 year ago
I have a form that gathers subscription information for a client that they want a csv file to import into their system.  I run into problems because users will sometimes add a comma in one of the fields which then gets into the csv and throws eerything into an error.    Is there a way to block the entry of commas? I have most fields set up with formatting for phone numbers and such, but the text boxes are what is giving me an issue. For example, one user wanted to register the names of both the husband and wife and separated them with a comma.  This made the wife's name become the house address and everything shifted to the right from there.   There is already tons of conditional formatting and external code to get things to work the way the customer wanted, so I'm not real excited about more code to tack on unless it's really necessary.   If needed, here is the url:  https://swgmove2zero.com/nv/   Thanks for any help on this!
1 Answers
Bobby Clapp answered 1 year ago
Maybe if you create a jQuery event that strips it on keyup. Something like: parseFloat(xVariable.replace(/,/g, '')) : 0;
Ken SchererKen Scherer replied 1 year ago

I'll give that a shot. Thanks so much!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right