PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Zip Code / State optional

  1. In an international form I'm building, the State / Province / Region field and Zip Code field are both optional in certain countries. If I mark an address group as required, is it possible to override the requirement for State / Zip via PHP (still passing a blank, but allowing it past the normal GF validation)?

    I think it might actually be related to the code I've been working with lately, the gform_validation filter, in which I need to check the is_valid value if it's false, and then check in the form>>fields>>field_id array if there's a failed validation / validation message set and override it if it's not a certain country. Figured I'd put my trek here in case anyone else comes across the same need.

    Posted 12 years ago on Saturday January 29, 2011 | Permalink
  2. I'm curious about this too. Ideally it would be nice if GF was smart enough to make those fields required or not-required based on the country that was selected.

    Posted 12 years ago on Thursday February 17, 2011 | Permalink
  3. paulburd - exactly why I'm having to go through the additional effort. Some countries don't have states or provinces and/or postal codes

    Posted 12 years ago on Thursday February 17, 2011 | Permalink
  4. Hi all, sorry to wake this sleeping thread, but I'm wondering if anyone has cracked this?

    I'm a new GF user looking for a way to make the address 'loosely' required; ie the user must input *something* in the address fields, but doesn't have to populate *all* the boxes. For instance, where I live in Wales I don't have a street name -- my address is just a house name, then the village ('city'), then the postcode/zip. This means it's impossible for me to fill out an address that is required.

    Am I going to have to build my own address fields manually, or is there a clever way of doing this?

    Posted 11 years ago on Friday July 29, 2011 | Permalink