In This Article:

    Always supply a country code, even when it's not in the page

    In This Article:

      A Salsa client had a business case that required that every supporter record have a Country code. When a Country appeared in a form, then a default Country code would be applied.  If a Country code was not in the form, a Country code was to be added.


      The solution was to add a script that made sure that the default Country code was applied even when the Country code was not being collected by a form.  If you'd like to have the same thing, then here are some steps that you can use.

      1. Edit a template.  If you need this behavior Salsa-wide, then edit each of your active templates.
      2. Locate the </body> tag.
      3. Insert a blank link just before the </body> tag.
      4. Click here to see the page where the solution lives.
      5. Click on the Raw button.  A window will open that has only the solution content.


      1. Copy the contents of the window and close it.
      2. Return to the template editor.
      3. Paste the copied text into the newly inserted line in the template.
      4. The default country is currently "US".  If you'd like a different default, then change all instances of "US" to the two-digit Country code of your choice.  Click here to see the list of valid country codes.
      5. Save the template.
      6. Test!


      If you have any questions, then please gather this information

      Send this information to, and we'll be glad to help.

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



      Please sign in to leave a comment.