Question T1037
Visible to All Users

Input type validation

created 7 years ago

Hi,

if I set input type of a single input to email, I would expect some kind of validation for email addresses. Same for url, datetime etc. The behavior of some input types seems to be different for different browsers.

Is this an issue or did you just not implement such a validation?

Thanks!

Comments (3)
DK DK
Dmitry Kurmanov 7 years ago

    Hello, for the text question we are using standard html input with type attribute and we don't change default behabiour for this inputs in different browsers.

    For the single behaviour you can use our Inputmask widget https://surveyjs.io/Examples/Library/?id=custom-widget-inputmask&platform=jQuery&theme=default
    Does it ok for you?

    Or you can create your own custom widget based on some library.

    Could you please descrive your use case in greater details?

    HH HH
    Hendrik Hansmeier 7 years ago

      Hi,

      I will try the Inputmask widget.

      My use case is very simple: If our customer creates a survey with the editor and selects input type email, he expects some kind of validation so that the person who fills in the survey can only fill this input with a valid email address. Otherwise it does not make sense for the creator of the survey to select any input type. If type email behaves just like type text, it does not make sense to select type email.

      Thanks!

        Hello Hendrik,

        I do understand your scenario. We'll discuss with the team how to improve the current behaviour.

        Thanks, Serge
        SurveyJS Team

        Answers approved by surveyjs Support

        created 7 years ago

        We've implemented adding "email" validation when text question changed inputType to "email". Please check https://github.com/surveyjs/surveyjs/commit/f950da538b0936e708ae56036d8541bfb5a91b6b . Fix will be available in the next release.