How to Capture Country Code with Phone Field [RESOLVED]

Thank you, @chrishajer!

We had previously tested the plugins you shared, and none seemed to work well at first.

So we decided to give the plugin, Smart Phone Field for Gravity Forms, another run (with a few adjustments and lots of testing performed) and now works beautifully.

In order for the plugin to function properly, these are the plugin adjustments that users need to make after activation:

(1) Go to: Phone field > Settings > General > and click on “Enable smart phone field” and “Automatically select countries”, then enter your default country. In our case, United States.

(2) Go to: Phone field > Settings > Advanced > and enter any country code in the Default Value field. In our case (US), we entered +1.

(3) When testing the plugin (frontend), and you purposely enter the wrong number for a given country, the form will display a message that says: “Invalie number” Obviously, this is a typo (should say “Invalid number”) and can be corrected as follows:

(a) Go to: /public_html/wp-content/plugins/smart-phone-field-for-gravity-forms/frontend/js/spf_main.js

(b) In edit mode, search for the keywords or term: “Invalie number” in the above file and change it to “Invalid number

Voila!

You got yourself an amazing new Phone field feature integrated into your form.

Wanna see the above in action? Visit: Book Us | Omnia Aerospace

Hope this helps. Again, thanks @chrishajer!

Cheers!

1 Like