Skip to content

Validation Error when putting 'separateDialCode' to true #57

@ElectricFiras

Description

@ElectricFiras

I'm using the PhoneInput widget with the "saperateDialCode" option set to true,
and I check the validation at submit, so when I submit it adds the dial code automatically to the input value and gives me a validation error "The format of Phone Number is invalid."
but when I remove the "separateDialCode" option and enter the same number it would accept it normally

this is my input code:
<?= $form->field($model, 'phone_number')->widget(PhoneInput::className(), [ 'jsOptions' => [ 'onlyCountries' => array_values($countries['iso']), 'separateDialCode' => true, 'allowDropdown' => false, ], ] ])

and this is my validation code in the model

[['phone_number'], PhoneInputValidator::className()]

and I'm using the version '0.1.2'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions