No dialing code selector for the phone field

Support DQE
Support DQE
  • Updated

Symptom: the phone field has no dialing code dropdown (+33, +39, etc.). A dropdown is expected to choose the dialing code.

Affected versions: 1.0.0.

Cause

The cartridge does not provide a dialing code selector. It reads the country selected in the form (the _country field) and sends the phone number to the DQE TEL service with:

  • Tel: the value entered, with spaces removed;
  • Pays: the form country converted to a 3-letter ISO code, using the country mapping included in the cartridge.

If a country is missing from this mapping, the 2-letter code is sent unchanged, and the result of the validation for that country may not be reliable.

Solution

The selector must be built on the client side, in your site's theme: the cartridge does not provide it. Third-party libraries exist for this need, such as intl-tel-input. They are not provided or recommended by DQE.

Points to handle during development:

  • Keep the _country field in sync with the selector, because the cartridge reads this field to determine the country.
  • Send DQE a number whose format matches the country. The response format is set by the site preference dqePhoneResponsePhoneFormat. If DQE returns a formatted number, it replaces the value of the field.
  • Check that every country offered in the selector is supported by the cartridge's country mapping. If one is missing, contact DQE support.

Verification

  1. Choose a country in the form and enter a number: in Business Manager, check in the dqe-phone log that Pays matches the chosen country.
  2. Repeat for each country offered in your selector.

Related to

Was this article helpful?

0 out of 0 found this helpful