• Resolved Maxim

    (@kokin93)


    Good afternoon!
    please tell me with my situation: in the settings of the phone field, if I choose validation “national”, then the form allows you to enter in addition to the current formats +79XXXXXXXX and 89XXXXXXXX, not necessary:

    +7-9-XX-XXXX-XX-X,
    +7-9-XX-XXXX-XX-X,
    +7-9-X-X-X-X-X-X-X-X-X,
    8-9-XX-XXX-X-X-XX.

    And if I choose Character Limit and Limit field to 11 characters, then the form allows you to enter all formats by limit, including those that are not needed. How can I make the form fill in the first “+7 ” characters in advance and limit the number of characters, for example, to 12, including those filled in automatically? Well, or validation national + Character Limit, provided that if +79xxxxxx, then the limit of characters is 12, and if 89xxxxxx, then 11?

    Or is this impossible?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @kokin93

    I hope you’re well today!

    Currently it’s “this or that” setup and types of validation (e.g. “national” and “character limit”) can’t be mixed or used at the same time.

    Also, if you select “national” validation you’ll be able to select countries but not limit/alter number formats “assigned” to chosen country – only those “built-in” are supported.

    We do have plans to improve that in future significantly by implementing option to add custom validation rules to any field – so you’ll be able to set your own data format/limits/rules easily and that would also fit this case perfectly.

    However, I’m afraid I don’t have any ETA on this yet. It’s on our “future features” list and as of now you’d need to go for one of the options that you already tested (either national or character limit validation “as is”).

    It might be possible to alter validation rules with additional code but it would require custom development which is a bit beyond the scope of our support. If you feel like giving it a go on your own, though, you could use this code as example/starting point (it’s for different fields but the same principle should work):

    https://gist.github.com/wpmudev-sls/6c4dabdbef947b6e47ab5d14d6d0da97

    Best regards,
    Adam

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @kokin93 ,

    We haven’t heard from you for a while now, so it looks like you no longer need our assistance.

    Please feel free to re-open this ticket if needed.

    kind regards,
    Kasia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘validations: current phone formats in the form’ is closed to new replies.