Web-to-Lead Forms

Learn how to create your own web-to-lead form following this specification.

The Form Tag

It all starts here. The enctype="multipart/form-data" attribute is only necessary if your form contains file attachments.
Be sure to include your api_key (required). Set debug to assist you when developing your form.

<form action="https://www.leadzep.com/insert" enctype="multipart/form-data" method="post">
	<fieldset>
		<legend>My Custom Form</legend>
		
		<input type="hidden" name="api_key" value="{api_key}" />
		<input type="hidden" name="debug" value="true" />
	</fieldset>
</form>

Form Fields

An index of fields available for web-to-lead forms.

Name Description Required Default
api_key Your API key is required to insert data into your account. You can find your API key on the sidebar of your forms page (login required). YES NULL
debug If set to true, relevant messages will be displayed should your form encounter any errors during submission. No False
campaignID Set to associate lead to a pre-defined campaign. You can find the campaignID on the sidebar of each form’s “Get script block” page. No NULL
redirect URL to redirect to after successful form submission.
Overrides the “Thanks URL” if set in a campaign (paid plans only).
No NULL
lead[assign_to] Use to assign a lead to a user in your account, based on their userID. The userID is displayed for each person in the first column of the table on the manage users page (login required). No NULL
lead[status] Use to pre-assign a status to a collected lead (range 1–6). details No 6
lead[firstname] The lead’s first name. No NULL
lead[lastname] The lead’s last name. No NULL
lead[title] The lead’s job title. No NULL
lead[company] If set, the system will try to match against existing companies and associate the lead; if no match, a new company is created. No NULL
lead[companyID] Use to associate lead to an existing company in your account. The companyID is displayed for each company in the first column of the table on the companies list (login required). No NULL
lead[addresses][street][] Add up to 3 mailing addresses to your form. This field is a textarea to accommodate street address, apartment/suite, etc. No NULL
lead[addresses][city][] Use in conjunction with lead[addresses][street][]. No NULL
lead[addresses][state][] Use in conjunction with lead[addresses][street][]. No NULL
lead[addresses][zip][] Use in conjunction with lead[addresses][street][]. No NULL
lead[addresses][country][] Use in conjunction with lead[addresses][street][]. Defaults to “United States”, via an HTML select dropdown. Get country dropdown No 233
lead[addresses][type][] Use in conjunction with lead[addresses][street][] (range 1–3).
The default address type is 1 (Home). view all types
No 1
lead[emails][address][] Add up to 3 email addresses to your form. No NULL
lead[emails][type][] Use in conjunction with lead[emails][address][] (range 1–3).
The default email type is 1 (Home). view all types
No 1
lead[networks][url][] Add up to 3 social network URLs to your form. No NULL
lead[networks][type][] Use in conjunction with lead[networks][url][] (range 1–3).
The default network type is 1 (Facebook). view all types
No 1
lead[notes][note][] You can add up to 10 notes per form which will appear in your lead’s activity stream. No NULL
lead[notes][label][] Used in conjunction with lead[notes][note][], this label will appear above the note in your lead’s activity stream, providing additional context. No NULL
lead[numbers][number][] Add up to 5 phone numbers to your form. No NULL
lead[numbers][type][] Use in conjunction with lead[numbers][number][] (range 1–5).
The default phone type is 1 (Home). view all types
No 1
lead[websites][url][] Add up to 4 website URLs to your form. No NULL
lead[websites][type][] Use in conjunction with lead[websites][url][] (range 1–4).
The default website type is 1 (Home). view all types
No 1
file Use to include an attachment with your lead. Currently only 1 file (< 10MB) per submission is allowed. No NULL
spam Use to combat spam. If included in the $_POST array, the submission will not be processed. No NULL
lead[custom][{fieldID}][] Add custom fields previously defined via our field creator. Replace {fieldID} with the corresponding field’s ID, located in the first column of the form index page (login required). No NULL

Form Validation

We prefer jQuery here at Lead Zeppelin, and we provide a single JavaScript file that wraps up jQuery 1.4.2 and their excellent validation plug-in (v1.5.5) in a single call. Just include the following <script> elements within the <head> of your HTML document:

<script type="text/javascript" src="https://www.leadzep.com/assets/js/client.validate.min.js"></script>
<script type="text/javascript">
// <![CDATA[
	$(document).ready(function(){
		$("#your_form_id").validate();
	});
// ]]>
</script>

For complete documentation on the jQuery validation plugin, see http://docs.jquery.com/Plugins/Validation