---
title: "Suggestions for the location field"
manual: "Job board"
version: "main"
permalink: "https://docs.typo3.org/permalink/jweiland/jobboard:address-search@main"
source: "Administration/AddressSearch.rst"
rendered: "2026-10-22T13:15:25+00:00"
---

# Suggestions for the location field {#address-search}

If the content element uses the address search field "Search field with
suggestions" (see [Address search field](https://docs.typo3.org/permalink/jweiland/jobboard:confval-plugin-addresssearchmode@main)), the search form
suggests ZIP codes and cities while the visitor types.

## How it works {#how-it-works}

The JavaScript of the job board sends a POST request with the HTTP header
`jobboard-address-search` and the form field `zipCity` after
three characters. The request goes to the URL of the current page, which
the search form provides in the attribute
`data-jobboard-address-search-url`. If the attribute is missing,
the path of the current page in the browser is used. The PSR-15 middleware
`\JWeiland\Jobboard\Middleware\AddressSearchMiddleware` (identifier
`jweiland/jobboard-address-search`) answers every frontend request
with this header with a JSON list of up to five entries:

**Example request**

```bash
curl -X POST -H 'jobboard-address-search: 1' \
    -d 'zipCity=123' https://example.org/jobs
```

**Example response**

```json
["12345 - Sample Town", "12349 - Sample Town-North"]
```

The middleware searches the fields ZIP code and city of all address
records (`tt_address`) in the pages of the site setting
[jobboard.storagePid](https://docs.typo3.org/permalink/jweiland/jobboard:confval-jobboard-storagepid@main). It respects the usual frontend
restrictions (hidden, deleted, start and end time). Each combination of
ZIP code and city is returned once, sorted by city.

## Own search form templates {#address-search-override}

The attribute is rendered in `Partials/Job/Search.html`. If you
override this partial, add it to your `<f:form>` as well:

**EXT:my_sitepackage/Resources/Private/Extensions/Jobboard/Partials/Job/Search.html**

```html
<f:form action="search"
        data="{jobboard-address-search-url: '{f:uri.page()}'}">
```

## Security {#security}

The address table is shared with other extensions and can contain
personal data. Therefore:

-   The pages to search are always taken from the site setting
    [jobboard.storagePid](https://docs.typo3.org/permalink/jweiland/jobboard:confval-jobboard-storagepid@main) of the current site, never from the
    request. The TypoScript setting
    `plugin.tx_jobboard.persistence.storagePid` is not used.
-   Only ZIP code and city are returned, no other fields.
-   An empty search term or an empty storage setting returns an empty list.

Keep only addresses that may be public in the folders listed in
[jobboard.storagePid](https://docs.typo3.org/permalink/jweiland/jobboard:confval-jobboard-storagepid@main). Every address in these folders is
searchable, not only the addresses used by jobs.
