Hello Everyone, Looking for some assistance to stop users from entering comma's into the address fields, I know I can code the "[a-zA-Z]" into the code but I need help finding out just where abouts to add the code. Cheers
Hello Everyone, Looking for some assistance to stop users from entering comma's into the address fields, I know I can code the "[a-zA-Z]" into the code but I need help finding out just where abouts to add the code. Cheers
And why do you want to stop shoppers using commas in their addresses?
Hello Strelitzia, The main and only reason to restrict the customer entering commas into name and address fields is when the order data is exported to either MYOB of a third party label or reporting program the commas can play havoc with the .txt file formatting. I'd like to restrict the entry to A-Z a-z 0-9 - . / only.
Cheers
Use str_replace if you want.
http://php.net/manual/en/function.str-replace.php
Our Site: http://zucando.com
Marketing Plugins: Marketing Modules
Free Response Templates: Responsive Templates
I don't know about restricting entry, but you can always take the entered value and delete every comma, or swap for a space, before storing/using.
Yes, with str_replace(',',' ',$address)
Hang on - @petsupplies4u, are you sure your order exporting program doesn't handle this? Typically fields will be enclosed in a value (like quotation marks, for example) so that commas within fields are ignored.
"Joe Smith", "10 Foo St., Apt 12", "Jonesville", "NSW"
That Software Guy. My Store: Zen Cart Modifications
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Bookmarks