Wordpress plugin for entering and validating international telephone numbers based on International Telephone Input. It adds new field to Ninja Forms, a (searchable) country dropdown to any input, detects the user's country, displays a relevant placeholder number, formats the number as you type, and provides comprehensive validation methods.
- Install using the WordPress built-in Plugin installer, or Extract the zip file and drop the contents in the wp-content/plugins/ directory of your WordPress installation.
- Activate ‘Ninja Forms‘ plugin through the ‘Plugins’ menu in WordPress.
- Activate ‘Smart Phone Addon for Ninja Forms‘ plugin through the ‘Plugins’ menu in WordPress.
- Go to Ninja Forms > Add New.
- Press the ‘Add new field‘ button.
- Select ‘Smart Phone‘ field.
- Change the settings in the Restrictions section to suit your needs (play with Storybook).
- Allow IP Lookup
Change default country depends on user IP
- Show Selected Dial Code
Display the country dial code next to the selected flag. Play with this option on Storybook (using the React component).
- Default Country
Country in the input by default
- Preferred Countries
Specify the countries to appear at the top of the list.
- Only Countries
In the dropdown, display only the countries you specify
- Allow Dropdown
Whether or not to allow the dropdown. If disabled, there is no dropdown arrow, and the selected flag is not clickable. Also we display the selected flag on the right instead because it is just a marker of state.
- National Mode
Allow users to enter national numbers (and not have to think about international dial codes).
- Auto Hide Dial Code
If there is just a dial code in the input: remove it on blur or submit. This is to prevent just a dial code getting submitted with the form. Requires nationalMode to be set to false.
- Exclude Countries
In the dropdown, display all countries except the ones you specify here.
- Format On Display
Format the input value (according to the National Mode option)
- Ninja Forms: OK | v3.8.0
- NF Conditional Logic: OK | v3.1
- NF Multi-Part Forms: OK | v3.0.26
- NF Layout and Styles: OK | v3.0.29