Skip to main content

Offer an Out When No Matches Are Found

No-Match Action

Sometimes a user genuinely cannot find their address - a new build, an unusual spelling, or an address not yet in the dataset. Without an escape hatch they are stuck at "No matches found".

Address Finder can render an actionable item beneath the no-match message. Use it to hand the user off to a fallback, most commonly a manual address entry form.

Enable

Set both options - the item only renders when the label and the callback are configured:

  • msgNoMatchAction - the label, e.g. "Enter address manually". Defaults to "" (disabled).
  • onNoMatchAction - invoked when the user selects the item. Address Finder closes on selection.
AddressFinder.setup({
apiKey: "ak_test",
inputField: "#search",
msgNoMatchAction: "Enter address manually",
onNoMatchAction: function () {
// e.g. reveal a manual address entry form
},
});

The item behaves like a suggestion: it can be clicked, or highlighted with the arrow keys and selected with Enter, and it is announced to screen readers as an option.

Styling

The item carries the idpc_action class (configurable via noMatchActionClass). The default stylesheet centers and underlines it - override the class to restyle. See CSS Classes.

Live Demo

Type nonsense (e.g. zzzzzz) to trigger the no-match message, then select Enter address manually.

Loading...