🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

Gravity Forms Dutch Postcode Autofill Premium Add-on Setup Guide

Updated 7 min read Gravity Forms Fields & Inputs
On this page
  1. Requirements
  2. Install and turn it on
  3. What the visitor sees
  4. Postcodes, house numbers and additions
  5. Several Address fields, pages and conditional logic
  6. When something goes wrong
  7. Where the data comes from
  8. Cache and limits
  9. Translations
  10. For developers: filters
  11. Frequently asked questions
  12. Do I need an account or an API key?
  13. Does it work with the Address types other than International?
  14. Will it overwrite what the visitor already typed?
  15. What about a visitor who has JavaScript switched off?
  16. Is the data always right?

The Gravity Forms Dutch Postcode Autofill Premium Add-on makes the native Gravity Forms Address field work the way Dutch visitors expect. They type a postcode and a house number, with an addition if there is one, and the street and city appear. It uses the free open address register of the Dutch government, so you need no account and no API key.

The lookup is a small box above the address inputs. Everything it fills stays editable, a missing address never stops the form, and every search goes through your own website, so your visitors’ IP addresses are not sent to the address service.

A Gravity Forms Delivery address field with a Find your address box above it holding the postcode 3581 WS, house number 10 and addition A, and below it the Street address Bolstraat 10A, City Utrecht, State Utrecht, ZIP 3581 WS and Country Netherlands already filled in
Type a postcode and a house number: the street, city, ZIP and country are filled in, and every field can still be edited.

Requirements

  • WordPress 6.5 or newer and PHP 7.4 or newer (tested up to PHP 8.3).
  • Gravity Forms 2.9 or newer (tested on 2.9.8 and 3.1.2), with the native Address field.
  • A website that can make outgoing HTTPS requests. The lookup uses one request per new postcode and house number.

Install and turn it on

  1. Install and activate the add-on, then activate your license key under Forms, Settings, Dutch Postcode. The key enables updates; the lookup itself works without it.
  2. Open a form in the form editor and select an Address field. International is the address type to use, because it has the Country drop-down.
  3. Open the Advanced tab and tick NL postcode lookup. Tick Also fill the province if you want the State / Province input filled too.
  4. Save the form and open it on your site. A box titled Find your address now sits above the address inputs.
The Gravity Forms form editor with an Address field selected, the Advanced tab open and two checkboxes, NL postcode lookup and Also fill the province
One checkbox per Address field turns the lookup on. The province is optional.

What the visitor sees

The box has three inputs: Postcode, House number and Addition (optional). As soon as the postcode and the house number are valid, and the visitor has stopped typing for a moment, the add-on looks the address up. The Find address button and the Enter key do the same at once. While it works the box says that it is looking up the address, and screen readers hear the messages because the message area is a polite live region.

When an address is found, these inputs are filled in:

  • Street address: the street name and the house number with its addition, for example Bolstraat 10A or Bolstraat 10B-2.
  • City: the place name from the address register.
  • State / Province: the province, for example Utrecht, only when you ticked the province option.
  • ZIP / Postal Code: the postcode written as 3581 WS.
  • Country: Netherlands.

A short message confirms it and asks the visitor to check the address. Nothing is locked: the visitor can change the street, add a floor or a company name, or correct the city, and the form saves exactly what is in the inputs when it is submitted. The postcode and house number box itself is only a helper and is not saved in the entry.

Postcodes, house numbers and additions

A Dutch postcode is four digits, the first one not zero, followed by two letters. The letter pairs SA, SD and SS are never used. The add-on accepts capitals or small letters, with or without a space or a dash, and writes the postcode in the box and in the ZIP input as 3581 WS. A postcode that does not fit gets a message with an example, and no request is made.

The house number box takes the number. The Addition box takes a letter (A), a number (3), or both (B 2 or B-2). Visitors who type 10b or 10-3 in the house number box get the same result, because the add-on splits the number from the addition. The addition is matched against the address register:

Visitor types Street address becomes Note
10 and nothing else Bolstraat 10 The plain house number.
10 and A Bolstraat 10A House letter A exists.
10 and B 2 Bolstraat 10B-2 Letter B and addition 2.
10 and 3 Bolstraat 10-3 Numeric addition.
10 and ZZ Bolstraat 10-ZZ Not in the register: street and city are still filled and the visitor is asked to check.

Several Address fields, pages and conditional logic

Each Address field with the lookup switched on gets its own box, so a billing address and a delivery address on the same form work independently. On a multi-page form the filled values stay when the visitor goes to the next page and back. AJAX forms work, including the re-rendered form after a validation error. When an Address field is hidden by conditional logic its box is hidden with it, and Gravity Forms does not save the hidden field.

If the Address field has the Country drop-down, the box is shown while the Country is the Netherlands or still empty, and it disappears when the visitor chooses another country. Choosing the Netherlands again brings it back. A successful lookup sets the Country to the Netherlands.

When something goes wrong

The lookup is a convenience and never a gate. These cases give a clear message and leave the form fully usable:

  • Invalid postcode or house number: a message with an example, no request is sent.
  • No address found: the visitor is asked to check the postcode and number or to enter the address.
  • Service down, slow or answering with something unexpected: the message says the lookup is not available right now and to enter the address below.
  • Too many searches: the visitor or the site has reached its limit, see below.
  • Out-of-date page: a page kept in a cache for more than a day has an expired security token. The visitor is asked to reload it and can still type the address.

Where the data comes from

Addresses come from the open BAG register of the Dutch government through the PDOK Locatieserver. It is a free public service and needs no key. The add-on asks it for the address that matches the postcode and the house number and uses only the street, the place name, the municipality and the province from the answer.

The browser never talks to PDOK. It sends the postcode and house number to a REST route on your own website. The route checks a security token (a nonce), checks that the form and the field really have the lookup switched on, applies the limits, looks in the cache, and only then asks PDOK. The visitor’s IP address, cookies and referrer are not forwarded. The request to PDOK carries only the postcode and the house number and a short product name.

Cache and limits

Under Forms, Settings, Dutch Postcode you set three numbers:

  • Cache time (default 168 hours): how long a found address is remembered. A postcode that was not found is remembered for at most one hour, and a failed request for 30 seconds, so a struggling service is not hammered.
  • Searches per visitor per 10 minutes (default 30): protects the service from one visitor or a script.
  • Searches per hour, all visitors (default 1,000): a ceiling for your whole site.

Only real requests to PDOK count. A search that is answered from the cache is free and never limited. When a limit is reached the visitor sees a message and types the address, and the counter starts again after the time window. The Test the lookup button on the same page makes one request for a public example address and shows what came back; it only runs when you press it.

The add-on settings in Forms, Settings, Dutch Postcode: the address data section with a Test the lookup button showing a connected message with the test address Dam 1, Amsterdam, and the cache time and search limit fields
One settings page for the data source test, the cache time and the search limits.

Translations

A complete Dutch (nl_NL) translation is included for the box, the messages and the settings page, and it is used when the site language is Dutch. The strings use the text domain gravityextra-nl-postcode-addon, so a translation plugin or your own language file can change any of them.

For developers: filters

  • gfxnlpc_lookup_pre: answer from your own provider instead of PDOK. Return an array with the status ok and the street, city, province, municipality, postcode, house and matched values, or null to keep PDOK. This is the place for a commercial address service with your own key.
  • gfxnlpc_answer: change what is sent to the browser, for example how the street and the house number are joined.
  • gfxnlpc_pdok_endpoint: change the address of the PDOK search endpoint.
  • gfxnlpc_client_ip: give the real visitor address when the site is behind a trusted proxy. It is used for the visitor limit only.
  • gfxnlpc_visitor_limit and gfxnlpc_site_limit_hour: override the two limits, with 0 for no limit.
  • gfxnlpc_timeout: the number of seconds to wait for PDOK, six by default.

Frequently asked questions

Do I need an account or an API key?

No. The default data source is a free public service without a key. If you prefer a commercial provider with your own key, use the lookup filter.

Does it work with the Address types other than International?

The box works wherever the Address field has the street, city and ZIP inputs. The country handling needs the Country drop-down, which only the International type has.

Will it overwrite what the visitor already typed?

It fills the inputs when a lookup succeeds, so a visitor who changes the postcode in the box gets the new address. Nothing is filled when a lookup fails.

What about a visitor who has JavaScript switched off?

The box needs JavaScript. Without it the address inputs work exactly as before, and the box does nothing.

Is the data always right?

The register is the official source, but new buildings and recent changes can take time to appear. That is why every field stays editable and the visitor is asked to check the address.

Let your Dutch customers type a postcode and be done

See the Dutch Postcode Autofill add-on

Still need help?

Our support team answers tickets every day, usually within a few hours.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr