SMS Confirmation widget: Apply Phone Number Format Validation

  • aksg
    Asked on June 20, 2024 at 11:58 PM

    Hello, we've implemented the [SMS Confirmation Widget](https://www.jotform.com/widgets/sms-confirmation) but I want to know how to validate the format of phone numbers. Right now if the user enters dashes, the OTP fails with an error which is a poor user experience.

    I came across this but not sure how to apply this within the widget: https://www.jotform.com/answers/5065668-use-input-mask-for-phone-field

  • Sonnyfer JotForm Support
    Replied on June 21, 2024 at 12:08 AM

    Hi Akshay,

    Thanks for reaching out to JotForm Support. Unfortunately, the SMS Confirmation Widget doesn't come with masking options to apply validation to the inputted mobile number. I've gone ahead and escalated your request to our developers, but when or if it's developed depends on their workload, how viable it is, and how many other users also request it. If there are any updates, we’ll circle back to this thread and let you know.

    Thanks for your patience and understanding, we appreciate it.

  • aksg
    Replied on June 21, 2024 at 12:12 AM

    Thanks, is there a way to use CSS to guide the input to avoid dashes? It seems like sometimes the phone with dashes works but other times it seems to fail.

  • aksg
    Replied on June 21, 2024 at 12:24 AM

    I actually think there might be a bug in the widget:

    `+1 ###-###-### ` works with a space after the number.

    `+1 ###-###-###` without the space causes an error.

  • Waqas JotForm Support
    Replied on June 21, 2024 at 12:42 AM

    Hi Akshay,

    Unfortunately, it is not possible to use CSS code to filter the characters that can be entered in the widget. We've already escalated your issue, and our developers are working on this as fast as they can.

    As soon as we have an update, we'll let you know.


 
Your Answer