Add a car make and model dropdown to any website

For Carrd, Framer, Elementor, booking tools and every builder that takes HTML; the checks to run before you paste.

The picker is ordinary HTML: select boxes and a script. Any builder that lets you paste HTML with a script can show it. Whether the vehicle then arrives with your form depends on two questions about the builder, and you can answer both in a few minutes before you commit to anything.

What you get

A make select, a model select that fills when someone picks a make, and a year select, from the official vehicle registers behind the VehiclesDB dataset. Cars by default; motorcycles, vans and trucks are an option. Every make, from Ford to Dacia, spelled the same way in every submission.

The block

Paste where the vehicle fields go

<label for="vehicle-make">Make</label>
<select id="vehicle-make" name="make"></select>

<label for="vehicle-model">Model</label>
<select id="vehicle-model" name="model"></select>

<label for="vehicle-year">Year</label>
<select id="vehicle-year" name="year"></select>

<script src="https://cdn.jsdelivr.net/npm/make-model-dropdown@0.4.1"></script>
<script>
  VehiclesDropdown.attach({
    make: "#vehicle-make",
    model: "#vehicle-model",
    year: "#vehicle-year",
    kind: "car",
    order: "popular",
    includeOther: true,
    otherLabel: "Other / not listed",
    placeholderMake: "Make",
    placeholderModel: "Model",
    placeholderYear: "Year",
    source: "dataset"
  })
</script>

This block works as it is, with no key and no account: it reads the open dataset and shows a small credit line under the picker, which free use requires. Paid plans can remove the credit line.

Want another language, vehicle kind or country? Choose your options and copy your own block. A free key adds make logos and puts the most registered makes at the top of the list.

Four checks before you paste

1. Does the builder keep <script> tags? Some builders strip scripts, or allow them only on some plans, or run them only on the published site. Paste the block, publish, and open the live page in a private window. If the picker shows there, this check passes.

2. Does the code run in an iframe? Some builders put embedded code in a separate frame (Wix does, for example). The picker then works inside that frame but can't join a form outside it. If your builder's embed is an iframe, the form has to live in the same embed as the picker.

3. Is the picker inside the form? A browser sends a field with a form when the field sits inside that form and has a name; a field without a name, or outside the form, is left out. The picker's fields are named make, model and year, so the block has to go inside the form, before the submit button.

4. Does the form keep fields it didn't create? Many form builders save only their own fields, even when the browser sends more. Elementor, for example, says its form's HTML field is for the form's behavior or appearance, while its other fields collect data. The only way to know is to send one test (below). If the vehicle is missing, look for a hidden field in your form builder: the WordPress guide shows how to copy the picker's choice into one.

Where the code goes in a few builders

  • Carrd: the Embed element (Pro Standard or higher, according to Carrd's docs), set to Inline so the code appears where you place it. It doesn't output anything in the builder; publish to see it.
  • Framer: the Embed component (Insert menu, search for Embed), with the block in its HTML section.
  • Elementor: the HTML widget, which only admins can use.
  • Booking tools and other builders: look for an element called HTML, Embed, Custom code or Code block, and run the four checks.

Using WordPress, Webflow, Wix, Squarespace or Shopify? They have guides of their own.

Check that it works

  1. Open the published page in a private window.
  2. Pick a make, a model and a year.
  3. Send the form to yourself, as a customer would.
  4. Look for make, model and year in what arrives, with values such as volkswagen, golf and 2019.

The picker is done when that test submission arrives with the vehicle in it, not when the lists appear.

Common problems

  • The picker shows in the builder's preview but not on the live site, or the other way round. Builders differ in where they run scripts. The live page in a private window is what counts.
  • The picker shows but the vehicle doesn't arrive. Check 3 or check 4 failed.
  • Nothing loads, and the browser console mentions a Content Security Policy. Your site sends a policy that blocks scripts from other sites. Allow https://cdn.jsdelivr.net for scripts and connections, and https://vehiclesdb.com for connections if your block has a key.
  • You use a block with a key. A key only works on the websites it is locked to. Keys made on the embed page are locked to your site and also work on your own computer (localhost) for testing. To test on a staging or preview address, add it to the key's websites in Settings first.

Questions people ask

Does the picker work in Carrd?

Carrd's Embed element takes HTML and JavaScript and, according to Carrd's docs, needs Pro Standard or higher. Carrd says the embed doesn't output anything in the builder, so publish the site to see it. Carrd's own forms use Carrd's own fields.

Does it work in Elementor?

Elementor's HTML widget accepts HTML and JavaScript, and Elementor restricts it to admins. Elementor's form widget also has an HTML field, but Elementor describes it as being for the form's behavior or appearance, while its other fields collect data.

Does it work in Framer?

Framer's Embed component has an HTML section that takes a script tag. Framer's help doesn't say whether fields inside an embed are sent with a Framer form, so test that before you rely on it.

What arrives in the form submission?

Fields called make, model and year, with short lowercase values such as volkswagen, golf and 2019, as long as the picker sits inside the form.