Data Pass for Custom Form Code Generator

Custom Form Tool

Vehicle Information Form Script Generator

Use this tool to generate a script that passes selected vehicle information from a Vehicle Details Page to a form located on a separate custom page.

What This Script Does

The script allows information from a vehicle listing to be included in the URL of a button. When a visitor clicks that button, the selected vehicle information is sent to a custom page and automatically entered into designated form fields.

1

Select Vehicle Information

Choose the vehicle values that should be sent to the custom form, such as the VIN, stock number, year, make, or model.

2

Update the Button URL

Add the generated query string to the end of the custom-page URL used by the button on the Vehicle Details Page.

3

Add the Script

Place the generated script on the custom page that contains the form. The script reads the information included in the URL.

4

Populate the Form

When the custom page loads, the script places each value into its assigned form field and hides that field's parent element.

Example: A visitor opens a Vehicle Details Page and clicks a button linked to a custom trade-in or information-request page. The button URL includes the vehicle's VIN and stock number. When the custom page loads, those values are automatically added to two designated form fields. /custom-page.html?vin=#VIN#&stock=#STOCK#

How the Generated Script Works

1

URL Parameter Function

The gup() function searches the custom page's URL and returns the value assigned to a specific parameter.

2

Vehicle Variables

A JavaScript variable is created for each selected vehicle value. For example, the VIN variable retrieves the vin URL parameter.

3

Form Field Assignment

The jQuery code applies each retrieved value to the selected form-field selector using the field's value attribute.

4

Hidden Field Container

After the value is applied, the script hides the selected field's parent element so the passed information does not need to be displayed to the visitor.

Generate Your Code

Select each vehicle value that should be passed to the custom page. For every selected value, enter the CSS selector of the form field that should receive it.

Generated Custom-Page Script

Add this script to the custom page containing the form. Confirm that jQuery is available on the page and that each generated selector matches the intended form field.

Script

Generated VDP Button URL

Add the generated query string to the end of the button URL on the Vehicle Details Page. Only the first parameter begins with a question mark. Every additional parameter is connected with an ampersand.

Entering a URL here creates a complete example href. Leave it blank when only the query string is needed.

Query String

Complete URL

Example Button HTML