Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Chris Borgman

    (@chrisborgman)

    OK, so I figured out that ‘min:5’ is for the actual number value and not the amount of digits.

    So now what…?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Sorry, I’m wrong. Number tags don’t support the minlength and maxlength options. Use this instead:

    [number* number-207 min:10000 max:99999]

    Thread Starter Chris Borgman

    (@chrisborgman)

    Thanks for your response!

    But when I use my zip code ‘07030’ then I get the message “This number is too small” because it starts with a zero.

    If I change to ‘min:00000’ then it allows zips starting with 0 but will also allow 3 or 4 digits.

    Would it be possible to add another number field in the generator that allows to force a certain number of digits?

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    It would be better to use text* instead of number* and add minlength:5 and maxlength:5 options as:

    [text* number-207 minlength:5 maxlength:5]

    You can also add a custom validation that shows an error when non-digit characters are input to the field, using the technique written here: http://contactform7.com/2015/03/28/custom-validation/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to force a 5 digit zip code?’ is closed to new replies.