Smart Phone Field for Gravity Forms

What does it do?

A simple and nice plugin to get auto country flag from user ip address on gravity form phone field. If the installation is okay, go to gravity forms dashboard. Add a phone field on your form. Open phone field and you will see to enable smart phone field checkbox.

Features

  • Live validation

    It checks the validation of the phone number. It triggers when the user completes typing or leaves the phone field. It will show a message/icon when validation triggers.

  • Multi step support

    It supports multistep form. Live validation and prevent submit with wrong phone number will work also.

  • Multiple flag option

    There is 2/3 type flap option in smart phone field settings. You can use according to your requirements.

  • Custom placeholder

    There is an option to remove or use a custom placeholder.

  • Prevent submit with wrong validation Pro

    Live validation will show whether your typed number is valid or invalid. If the user tries to submit with the wrong phone number, There is a server-side validation. It prevents submitting the form with the wrong phone number.

  • Multiple format in notification Pro

    There are 4 types of notification options in smart phone field settings. By default, you will get a phone number with the country code.

  • Select country of address field with user IP address​ Pro

    In the address field, have an option to auto-select the user country according to the user's IP address.

  • Get city, postal, country and more based on IP address via merge tag​ Pro

    You can get some extra data from the user's IP address. Ex. city, state, county, country, zip code, currency, and more. This information will be collected from an API. You have to register and you can use it.

  • Get country code, name, dial code separately in text field​ Pro

    You can get the user's phone number data in the text field. Ex: country code, name, dial code. It will work when the user changes the country from the dropdown.

  • Automatic updates.​

    Get updates and the latest features right in your dashboard.​

How do I enable this functionality?

Live Validation

Live validation is added by default. There are not on/off option.

Server side validation

It validates the phone number before submitting the form. You have to enable the active phone number validation checkbox.

Flag Option

There are 3 types of flags that you have to select from Phone Field Flag Options. The default flag is flag with the country code.

Phone Meta

In the phone metadata, you can automatically populate the country code, country name, and country dial code in the text fields. These fields will display the phone number ID and phone metadata, and they will update automatically when the phone field is loaded or changed.

User's IP marge tag

To find the user IP address information with the merge tag, you have to enable IP merge tag from the gravity forms settings page. And use the merge tag in fields.

				
					{spf_ip}
{spf_city}
{spf_region}
{spf_country}
{spf_postal}
{spf_timezone}
{spf_latitude}
{spf_longitude}
				
			

Detect country in address field

To find the user country in the address field, you have to enable automatically select country. And it will be ready for use.

Filter Hook

This filter can be used to modify the options used to initialize a smart phone field.
 
Options for smart phone field.
				
					countrySearch = true/false,
excludeCountries = [],
fixDropdownWidth = true/false,
onlyCountries = [],
showFlags = true/false,
separateDialCode = true/false,
strictMode = true/false,
formatOnDisplay = true/false,
autoPlaceholder = true/false,
countryOrder = [],
customPlaceholder = function(selectedCountryPlaceholder, selectedCountryData) {
    return "e.g. " + selectedCountryPlaceholder;
},
formatAsYouType = true/false,
i18n = {} //object for Internationalisation
nationalMode = true/false,
validationNumberType = MOBILE/FIXED_LINE,
allowDropdown = true/false,
autoPlaceholder = polite/aggressive/off
				
			
Use of filter hook for smart phone field.
				
					<script>
gform.addFilter( 'gform_spf_options_pre_init', function( optionsObj, formId, fieldId ) {
    // do stuff
    if ( formId == 12 && fieldId == 1 ) {
        optionsObj.initialCountry = 'bd';
        optionsObj.countrySearch = false;
    }
  
    return optionsObj;
} );
</script>
				
			

You will love our solutions

Take a look at our highly rated premium and free
WordPress plugins