Skip to content

This plugin is an addon to the Ninja Forms plugin. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.

License

GPL-2.0, GPL-2.0 licenses found

Licenses found

GPL-2.0
LICENSE
GPL-2.0
LICENSE.txt
Notifications You must be signed in to change notification settings

JDI-company/Smart-Phone-for-Ninja-Forms

Repository files navigation

Ninja Forms SPN Addon

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.

International Telephone Input

Installation

  1. 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.
  2. Activate ‘Ninja Forms‘ plugin through the ‘Plugins’ menu in WordPress.
  3. Activate ‘Smart Phone Addon for Ninja Forms‘ plugin through the ‘Plugins’ menu in WordPress.
  4. Go to Ninja Forms > Add New.
  5. Press the ‘Add new field‘ button.
  6. Select ‘Smart Phone‘ field.
  7. Change the settings in the Restrictions section to suit your needs (play with Storybook).

Smart Phone

Features

  • Allow IP Lookup

IP Lookup

Change default country depends on user IP

  • Show Selected Dial Code

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

Default Country

Country in the input by default

  • Preferred Countries

Preferred Countries

Specify the countries to appear at the top of the list.

  • Only Countries

Only Countries

In the dropdown, display only the countries you specify

  • Allow Dropdown

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

National Mode

Allow users to enter national numbers (and not have to think about international dial codes).

  • Auto Hide Dial Code

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

Exclude Countries

In the dropdown, display all countries except the ones you specify here.

  • Format On Display

Format On Display

Format the input value (according to the National Mode option)

Compatibility with Ninja Forms addons

  • 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

About

This plugin is an addon to the Ninja Forms plugin. It adds a flag dropdown to any input, detects the user's country, displays a relevant placeholder and provides formatting/validation methods.

Topics

Resources

License

GPL-2.0, GPL-2.0 licenses found

Licenses found

GPL-2.0
LICENSE
GPL-2.0
LICENSE.txt

Stars

Watchers

Forks