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.
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.
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.
Choose the vehicle values that should be sent to the custom form, such as the VIN, stock number, year, make, or model.
Add the generated query string to the end of the custom-page URL used by the button on the Vehicle Details Page.
Place the generated script on the custom page that contains the form. The script reads the information included in the URL.
When the custom page loads, the script places each value into its assigned form field and hides that field's parent element.
/custom-page.html?vin=#VIN#&stock=#STOCK#
The gup() function searches the custom page's URL
and returns the value assigned to a specific parameter.
A JavaScript variable is created for each selected vehicle
value. For example, the VIN variable retrieves the
vin URL parameter.
The jQuery code applies each retrieved value to the selected
form-field selector using the field's
value attribute.
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.
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.
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.
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.