Is it possible to use an address field and only require the zip code field?

  • Profile Image
    matchmakertennis
    Asked on February 03, 2012 at 12:17 PM
  • Profile Image
    abajan
    Answered on February 03, 2012 at 01:25 PM

    That can be done but the full source of the form would have to be embedded and the validate[required] class removed from the input tags of the "Street Address", "City" and "State / Province" elements and the select tag of the "Country" element.

    Tip: Before getting the form's source from the Embed Form Wizard, inject the following CSS:

    .form-line-error {
    background:none repeat scroll 0 0;
    }

    As luck would have it, the error message's arrow points to the zip code element. So, injecting the above rule (which surpresses the display of the pink background highlighting unfilled required fields) would make it seem as though the message only refers to the zip code, which it in fact does! Hitting the submit button on this demo form will illustrate my point. If you view the source of that page you'll see only one occurrence of validate[required] and it's in the zip code's input tag. (Incidentally, the error messages were also edited before acquiring the form's code.)