Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Sharath

    (@sharath-chandra-prathiwadhi)

    Hello burgerwordpress,

    In the Pro version you can add a regex after selecting the mandatory field which will limit the characters.
    The regex for the limiting the number field to 500 characters is ^[0-9]{0,500}$, if it is a text field then it would be ^[a-zA-Z0-9 ,.-]{0,500}$.

    Cheers.

    Thread Starter burgerwordpress

    (@burgerwordpress)

    Hello Sharath, thanks a bunch. I will try it out.

    Thread Starter burgerwordpress

    (@burgerwordpress)

    Hello Sharath,

    I have tried your solution and it does not seem to be working. May be there is something I am doing wrong. Would your solution work for fields like name, first name, last name etc ?
    This is what I do to implement your solution.
    1) Edit a field
    2) check the mandatory field box
    3) In the Regex Expression drop down, I select “OTHER”
    4) In the field below that says “Please fill the below Field”, I input the Regex expression.

    Is this how you do it?

    Thank You.

    Plugin Contributor Sharath

    (@sharath-chandra-prathiwadhi)

    Hello burgerwordpress,

    Yes that’s the way.Its working for me, I have tested it. This setting will throw an error when user tries to enter more than the restricted number and will not allow him to submit the form. Is this your requirement ??? or you want to totally block the user from entering more than the restricted number, if so that feature is currently not available. We are putting it on development roadmap and will try to release as soon as possible.

    Cheers.

    Thread Starter burgerwordpress

    (@burgerwordpress)

    Hi Sharath,

    Thanks for your prompt response.
    I was hoping I will be able to block the user from entering the restricted number of characters. For example for a text field, if I want to restrict the user to a maximum limit of 5 characters, then the user should not be able to enter more than 5 characters in the text field. If this has not been implemented, then I am looking forward to this. This is a very important piece in cleaning user’s input. I look forward to hearing from you soon.

    Thanks,
    Carlson

    Thread Starter burgerwordpress

    (@burgerwordpress)

    Please check out this link – https://wp.lemondeconnect.org/c-life-application/

    I have used the regex ^[a-zA-Z0-9 ,.-]{0,20}$ to limit character to 20 max but the error message keeps showing when I enter text in the first name field and navigate to the next field. What am I possibly doing wrong?

    Plugin Contributor Sharath

    (@sharath-chandra-prathiwadhi)

    Hello Burgerwordpress,

    The regex used for first and last names are ^[a-zA-Z0-9 .-]+$ and ^[a-zA-Z0-9 ,.-]{0,20}$. which are wrong. Last name field regex has a dot in the end which is throwing the error constantly. Please change them and the form works properly.

    Cheers.

    Thread Starter burgerwordpress

    (@burgerwordpress)

    Sharath, Thanks a lot for your prompt response.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Character Restriction in Text Field’ is closed to new replies.