Validation : No Space

prevent spaces in a required text field.

Overview

The field accepts spaces, which are invalid for the intended input format.
Add a Regular Expression validation rule to the element's Setup Tab, specifying a pattern that excludes spaces and defines allowed characters and length.

Answered
ChronoForms v6
om omidhz 16 Jul, 2019
I have a text field that is required. But I like to prevent users from entering space in that field.
How can I add validation to prevent space?
Thanks
Gr GreyHead 16 Jul, 2019
Answer
Hi omidhz,

Adding a Regular Expression validation on the element Setup Tab is probably the simplest way,

Bob
om omidhz 24 Jul, 2019
1 Likes
Thanks.
For anyone else looking to do this, here is the regular expression I used:
^[A-Za-z0-9_-]{5,15}$
It allows letters, numbers, underscore and hyphen only, Min 5 and max 15 chararcters.
This topic is locked and no more replies can be posted.