Skip to main content

How to Change Field Labels Based on Country Selection

Dynamically change form field labels based on country selection, such as switching between 'Zip Code' and 'Post Code'.

Updated over 9 months ago

Why customize field labels?

Every form on your website serves a slightly different purpose. Customizing field labels improves the user experience by using familiar terminology and reinforcing that users are in the right place.

Different countries often use different terminology for the same concept. For example:

  • United States: "Zip Code"

  • United Kingdom: "Post Code"

  • Other countries: "Postal Code"

Traditionally, addressing these differences required creating separate forms for different regions. With Formulayt, you can dynamically change field labels based on country selection within a single form.

Creating a dynamic zip/post code label

Follow these steps to automatically change your "Zip Code" field label to "Post Code" for specific countries:

Step 1: Set up the rule trigger

Trigger: Set to run continuously

This setting is critical because the country field is visible to users and its value can change in real-time as they complete the form.

Step 2: Define the conditions

Conditions (IF):

  • Field: country

  • Condition: is in

  • Value: GB,CA,NL

This checks if the selected country is either United Kingdom (GB), Canada (CA), or the Netherlands (NL) using their two-digit ISO codes in a comma-separated list.

Step 3: Configure the primary action

Actions (THEN):

  • Action: Change field label

  • Field: zip_code (or your actual field name)

  • New Label: Post Code

  • Translation Label: PostCode

The translation label ensures this custom text can be properly indexed in your translations area if you support multiple languages.

Step 4: Add the otherwise action

Otherwise:

  • Action: Reset field label

  • Field: zip_code (or your actual field name)

This ensures that if a user changes their country selection from GB/CA/NL to another country (e.g., US), the field label will revert to its original text.

Best practices

  1. Place the country field before the zip/post code field in your form layout

  2. Test the form with different country selections to ensure a smooth user experience

  3. Consider adding similar rules for other country-specific terminology in your forms

Did this answer your question?