Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author ulihake

    (@ulih)

    Hello Balle.

    Should be possible if you use a custom text input field. The configuration button for the field, once added to the form section, displays in the type column. You can configure the max-length for the field. But people tend to facilitate their phone number in number blocks of 2 and 3 digits. I will add support for the html5 pattern attribute on input fields in one of the next updates which will allow you to establish regular expressions validated by the most client browsers.

    Regards.
    uh

    Plugin Author ulihake

    (@ulih)

    Hello Balle.

    I will close this evening if there’s no feedback. You can still reply afterwards.

    R.
    uh

    Plugin Author ulihake

    (@ulih)

    Feel free to contact again if you feel that the answer is not satisfying.

    R.
    uh

    Thread Starter Morten

    (@ballemortenballenet)

    Hi Ulihake

    Just came home tonight after weekend out. Sorry for delay.
    I can set max-length.., but I would like to be able to set ‘min length’ as well. That part I can’t figure out…

    Best,
    Morten

    Plugin Author ulihake

    (@ulih)

    Hello again.

    minlength does not exist as implemented attribute. Pattern attribute is supported by most browsers. That’s the way to go as you could easily define a min and maxlength regular expression pattern. Will be available soon but right now you could only use some javascript to establish and test this.

    Regards.
    uh

    Thread Starter Morten

    (@ballemortenballenet)

    Perfect!
    Thank you for taking time to answer this…

    Best,
    Morten

    Plugin Author ulihake

    (@ulih)

    Hello balle.

    The next update, will be published today, includes support for the pattern attribute and a fall-back for Safari browsers to assure things for almost every customer.

    R.
    uh

    Thread Starter Morten

    (@ballemortenballenet)

    Perfect, and thanks for the info and effort.
    Works like a charm…

    One thing though.., would be nice to be able to define the alert-text and not just settle with the standard.

    Found this: http://stackoverflow.com/questions/10361460/how-can-i-change-or-remove-html5-form-validation-default-error-messages
    – but I cant figure out where to place the code…

    Best,
    Morten Balee

    Plugin Author ulihake

    (@ulih)

    Hello Morten.

    Another possible improvement, but this time you will have to wait a bit. I will release a service release update for WC 2.2 but afterwards I will work on features for the big brother.

    But take for granted that I will place an additional field to specify the invalid message… In the meantime you will have to live with the browser implementation…

    Regards.
    uh

    Thread Starter Morten

    (@ballemortenballenet)

    🙂
    thanks for the effort!

    Best,
    Morten

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Set exact amount of characters’ is closed to new replies.