Problem/Motivation

Webform Phone provides a great Webform component, but it requires input to be validated against specific country validation rules. In some use cases this validation can be counterproductive, for example when the country of origin is ambiguous.

Proposed resolution

Make country validation optional, so users can submit a Webform that was not designed for their specific country.

Remaining tasks

  1. Write a patch
  2. Review changes

User interface changes

None

API changes

None

Data model changes

None

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
StatusFileSize
new957 bytes

Attached patch makes country validation optional for Webform Phone components.

RadioActiv’s picture

Status: Needs review » Needs work

Patch only makes the option of "None" available, it doesn't address the validation or formatting code.

There is an option for "International Phone Number" in the country list, it's made for when the values could be for more than one country, that might give you the functionality you want...

idebr’s picture

Status: Needs work » Needs review
StatusFileSize
new2.27 KB

Patch only makes the option of "None" available, it doesn't address the validation or formatting code.

I missed that the country was necessary for saving the webform component data. The attached patch includes saving the input value correctly.

There is an option for "International Phone Number" in the country list, it's made for when the values could be for more than one country, that might give you the functionality you want...

I tried the "International Phone Number" formatter, but it updates the component value with additional formatting, eg. '020-1234567' becomes +20-1234567. My use case does not involve updating the submitted value.