> For the complete documentation index, see [llms.txt](https://developers.getgeoflow.com/geoflow-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.getgeoflow.com/geoflow-docs/feature/form/auto-populate-select-fields.md).

# Auto-Populate Select Fields

### How Does It Work?

Apply the Geo Select data attribute to a \<select> element, using a value corresponding to the variable name for one of the available categories in the table at the bottom.

### How To Implement

<table><thead><tr><th>Attribute Name</th><th width="268.3333333333333">Attribute Value</th><th>Which Page Element?</th></tr></thead><tbody><tr><td>data-geo-select<mark style="color:red;">*</mark></td><td>category-name</td><td>&#x3C;select></td></tr><tr><td>data-gs-placeholder</td><td>Your Custom Placeholder</td><td>Any element with the <strong>Geo Select</strong> data attribute.</td></tr></tbody></table>

The category name is case-sensitive and must match the respective 'Category Variable'.

The default placeholder option for the \<select> element will be 'Choose an Option'. You can override this by setting the placeholder data attribute noted above.

The Geo Form data attribute does not need to be added to the \<form> element for the Geo Select data attribute to function.

<mark style="color:red;">\*</mark>‎‏‏‎ ‎Attribute names with a red asterisk are required; all others listed in the table are optional.

{% hint style="info" %}
**Developer Tip**: With a little JavaScript, you can dynamically update the options in one \<select> based on what was chosen in another. For example, if someone chooses 'Canada', add Canadian provinces and territories. [View the code snippet](/geoflow-docs/advanced/code-snippets.md#populate-list-of-provinces-states-based-on-chosen-country).
{% endhint %}

### Available Categories

| Category Name                      | Category Variable            |
| ---------------------------------- | ---------------------------- |
| African Countries                  | af-countries                 |
| All Countries                      | all-countries                |
| Antarctican Countries              | an-countries                 |
| Asian Countries                    | as-countries                 |
| Australian States and Territories  | au-states-and-territories    |
| Canadian Provinces and Territories | ca-provinces-and-territories |
| European Countries                 | eu-countries                 |
| North American Countries           | na-countries                 |
| Oceania Countries                  | oc-countries                 |
| South American Countries           | sa-countries                 |
| United Kingdom Countries           | uk-countries                 |
| American States                    | us-states                    |

### Examples

```html
<!-- This <select> Will Be Populated with North American Countries -->
<select data-geo-select="na-countries" data-gs-placeholder="Choose a Country">
</select>

<!-- This <select> Will Be Populated with American States -->
<select data-geo-select="us-states" data-gs-placeholder="Choose a State">
</select>

<!-- This <select> Will Be Populated with Australian States and Territories -->
<select data-geo-select="au-states-and-territories" data-gs-placeholder="Choose a State or Territory">
</select>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.getgeoflow.com/geoflow-docs/feature/form/auto-populate-select-fields.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
