[Solved] How to create textfield validation which does not allow blanks / spaces?


Hi, for a registration for I would like to have a text field for passport numbers.

I wil use this number later as identifyier and would like respondents not to be able to insert blanks or spaces,

not allowed: “A12 34567″ or ” A12 34567 “

allowed: “A1234567”


What string do I have to enter for the validation rule?



On your help site I found a few examples, but not what I was looking for:



Best regards,


Jim W (Moderator) selected answer

    Best answer


    You could use a REGEX validation.

    In the ANSWER FORMAT field, select REGEX.  This allows you to enter various patterns that can be used to validate responses (http://help.surveygizmo.com/help/article/link/textbox-answer-formats#regex-patterns-for-complex-validation).

    I could not find a REGEX pattern specifically for passport ID numbers, but there is one that allows alpha-numeric characters but not spaces (http://regexlib.com/REDetails.aspx?regexp_id=12).

    Jim W (Moderator) selected as best answer


      Passport number are a set number of characters.  Would imposing a character limit work?  http://help.surveygizmo.com/help/article/link/min-max-word-character


      Mary L (Moderator) answered


        Question stats

        • Active
        • Views1364 times
        • Answers2 answers
        • Followers1 follower