Validate State or Zip+4?

Home Forums Jquery Validation for Contact Form 7 Validate State or Zip+4?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #512334 Reply
    Nicole Thelin
    Guest

    Hey,

    I am trying to block form submissions outside the state of Utah.

    I have been using a range for the zip codes, but it doesn’t work if people use Zip+4 instead of just five digits. I was using AddressZen to validate addresses and it automatically populates Zip+4, so the range wasn’t working.

    Is there a way to flag an error if the state doesn’t exactly match Utah?

    Or is there a better way to do this?

    Please advise.

    Thanks!

    #512349 Reply
    Dinesh
    Keymaster

    Hi Nicole,

    Blocking form submissions based on specific zip codes, especially with Zip+4, can be quite challenging. Unfortunately, our plugin doesn’t support this level of filtering.

    Sorry we don’t have a more direct solution for zip codes.

    Best regards, Dinesh

    #517146 Reply
    Nicole Thelin
    Guest

    I appreciate your response. Maybe there’s a way to use the State field instead of Zip?

    Is there any way to set the state validation so that if it doesn’t exactly match UT or Utah, the form can’t be submitted?

    Thanks!

    #517189 Reply
    Dinesh
    Keymaster

    Hi Nicole,

    One option is to use the Custom Code Validation feature available in the Pro version. You can add all the valid state or zip values there and set up validation accordingly.

    You can check this video.

    Best,

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Validate State or Zip+4?
Your information: