Loading

Make a Field Required on a Salesforce Web-to-Lead Form

게시 일자: Jul 13, 2026
상세 설명

This article explains how to make a field required on a Salesforce Web-to-Lead form. When using Salesforce Web-to-Lead, the form that captures lead information from your website is generated as HTML code. By default, form fields are not marked as required, which means leads can be submitted with incomplete data.
Adding the Required attribute directly to the HTML input element enforces client-side validation, displaying an error to the visitor if they attempt to submit the form without completing that field. Note that Salesforce server-side validation rules can also reject incomplete submissions, but these prevent the record from being saved rather than providing a visible form-level message to the user.

솔루션

How to Make a Text Field Required

To make a text input field required on the Web-to-Lead form, add the word Required at the end of the input tag syntax. The field will then display a browser-native error message if the visitor tries to submit the form without entering a value.
Example for a text input field:
The HTML for a required First Name field looks like this — add Required after the field size attribute:
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" Required />

How to Make a Picklist Field Required

For picklist (dropdown) fields on the Web-to-Lead form, add the attribute required="required" inside the opening select tag.
Example for a picklist field:
<select id="00NA000000Abtqs" name="00NA000000Abtqs" title="Builder Name" required="required">
The options inside the select element remain unchanged. This attribute instructs the browser to require a non-empty selection before form submission.


Knowledge 기사 번호

000385229

 
로드 중
Salesforce Help | Article