Selecting your country in the form’s field

Last updated: February 24, 2021 Written by: Avatar Teresa
share
Table of contents
share
Table of contents

If you want to create a form with field offering your user many possibilities to choose from, follow the steps below – we will show you how to make a select field with a base of countries.

How to prepare ‘choose your country’ field in the form based on the select field?

1. Go to the settings of your form widget either from the context menu (1) or toolbar (2).

2. Add a new Select field to your form.

3. Enter Label name (1), click Additional options (2), and type "country" in name attribute. Click Save and close.

4. Save changes.

5. Copy the following code.

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-formhelpers/2.3.0/js/bootstrap-formhelpers.min.js"></script>
<script type="text/javascript">
  $(function() { 
    $('select[name="country"]').bfhcountries({country: 'US'}); 
  }); 
</script>

6. Go to Dashboard -> Javascript codes, add a new script.

7. Type in a name (1), paste your code (2), select Body bottom (3), and Main page (4). Click Add. 

8. Publish your landing page. Check whether the form displays correctly.

share

Was this manual helpful?