Making parts of address required

Discussion in 'Customization & add-ons' started by mdmr_llc, May 29, 2008.

  1. mdmr_llc

    mdmr_llc Member

    Joined:
    Aug 22, 2006
    Messages:
    62
    Is it possible to make only some parts of address required fields. I only need zip, state and country. I'll be willing to mod the code directly.

    :rolleyes:
  2. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    To avoid hacking the code, the first thing that comes to mind is:

    1) Not show the out of the box address fields (set "Use Address Info" in Admin CP to No.
    2) Then create custom fields that have your zip, state and country

    An alternative option is again setting show address to no, and then manually editing the Signup template to include the field and adjust that it is required for submit
  3. mdmr_llc

    mdmr_llc Member

    Joined:
    Aug 22, 2006
    Messages:
    62
    My only concern is that I already have thousands of members that created profiles with entire address being required. Keeping that in mind, I do not want to go with custom fields. I think it is still easier to remove validation settings from certain fields. It is strange that the entire address is either required or not. More often one would want to customize which fields should be required, I think.
  4. calisolllc

    calisolllc Member

    Joined:
    Feb 19, 2007
    Messages:
    194
    The easy solution to that problem would be to run with Skippy's solution and write a small MYSQL script to populate the new fields in the existing members records. A one shot deal and its achieved, no code hacking, no maintenance problems for upgrades etc
  5. mdmr_llc

    mdmr_llc Member

    Joined:
    Aug 22, 2006
    Messages:
    62
    I'll give it more thought once I sort through this mess with upgrade.

Share This Page