Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
- This topic has 3 replies, 2 voices, and was last updated 12 years, 6 months ago by
Steven Zahm.
-
AuthorPosts
-
01/29/2014 at 1:09 pm #278536
Mitch
ParticipantIs there a way to ‘force’ a specific format of the phone input field display?
What I mean is we have some entries that are entered (123) 454-7890 and some that are entered 123-456-7890. That drives me absolutely bananas.
Obviously, we could go manually change them. Ugh. And, yes, we can have rules for how they are *supposed* to be input… but it seems with importing and people in general, those don’t always get followed. Sigh.
It would be great if we just entered the digits into the box, and then the display is outputted as whatever format we set in settings, globally.
Thoughts?
Thanks.
01/29/2014 at 1:56 pm #278547Steven Zahm
Keymaster@ Mitch
What is being used to input the data, the add entry page, Link or Form?
You could make an edit the code so the input for the phone number is like this:
<input type='tel' pattern='\d{3}[\-]\d{3}[\-]\d{4}' title='Phone Number (Format: 123-456-7890)'>I can’t really put this in Connections because the pattern changes depending on the county and even then there are multiple valid acceptable patterns. That why I decided to just leave it a free text input.
Oh, this will only be enforced on more modern browsers. Anyone using Chrome or Firefox should be fine. And I think it’ll only work on IE10+.
Hope that helps!
01/29/2014 at 2:08 pm #278552Mitch
ParticipantAt this point, most of the entries are coming from csv import, or from manual entry page. We are just starting to rollout Form, but its slow going there.
I understand the various pattern changes, so I get why it can’t be across the board. No worries.
I guess it would be cool to have a dropdown on the global settings page which allowed an admin to select from a few of the most common formats, that they wanted to apply across their entire database. e.g. (123), 123-, 44-1234- etc… Maybe include an option in the dropdown for unformatted, which could even be the default (and would allow for any unique format structures). Just a thought.
So, if I wanted to use this code above, where would I place it?
And if I wanted the format to be (123) 456-7890, what would that look like?
Thanks!
01/29/2014 at 3:09 pm #278570Steven Zahm
Keymaster@ Mitch
Not likely I’ll be adding a setting … I’ll never make everyone happy. This won’t make 0.8, but, I’ll be adding a methods (filters) that will allow these types of changes to be made in an update safe way.
I think this would be the correct pattern for your phone format would be:
((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}That would make the entire line like this:
<input type='tel' pattern='((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4}' title='Phone Number (Format: (123) 456-7890)'>The lines you need to edit are here and here. It’ll change in 0.8. Also, you will not be able to just copy past this, you’ll need to update. I think you’ll see what I mean when you look at the source code.
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.
