In This Article:

    Set the default country on a donation page

    In This Article:

      Background

      If your organization is primarily involved with campaigns outside of the United States, it would be helpful have all of your donation pages select a different country when a donor arrives on the page. In other cases, your organization may just want to see the states or provinces for that country, and not show the country field at all. This article shows how to do both.

      Audience

      • Campaign managers that edit donation pages
      • Campaign managers that edit templates
      • Campaign managers with Javscript experience

      Details

      The process here is to install a bit of Salsascript that both sets the default country and hides the country field.

      Before you begin

      • Make sure that you've added the Country field on the donation page. If you need help doing that, then please click here.
      • Salsa uses two-digit country codes, so you'll need to know that code before you start. Here are codes that we see a lot:
        • CA:Canada
        • CH:Switzerland
        • DE:Germany
        • ES:Spain
        • FR:France
        • MX:Mexico
        • US:United States

      Don't see your country? Please click here for the list of valid country codes.

      Installation

      1. Edit the template used by donation pages. Click here if you need help getting started.
      2. Locate the </body> tag.
      3. Insert a blank line just before the </body> tag.
      4. Click here to see the Github page where the solution lives.
      5. Locate and click the "Raw" button. A new window will appear that contains just the script.
      6. Copy the contents of the window and close it.
      7. Return to the template editor.
      8. Paste the copied text into the newly inserted line in the template.
      9. Change the country code by replacing US with your country code in this line:

      f.val('US').change();

      1. Save the template.
      2. Test!

      Questions?

      If you have any questions, then please gather this information.

      • Your organization_KEY
      • Your chapter_KEY if you are in a chapter
      • The template_KEY of the modified template
      • The donate_page_KEY (or URL) of a donation page that uses the template
      • A screenshot of the page, if possible.

      Send this information to support@salsalabs.com and we'll be glad to help.

      Was this article helpful?
      0 out of 0 found this helpful
      Have more questions? Submit a request

      Comments

      0 comments

      Please sign in to leave a comment.