Required fields prevent visitors from submitting a form without providing information that is necessary to process their enquiry. Use them only for information you genuinely need.
1. Decide which information is necessary
Review what you need to respond to or process an enquiry.
For a basic contact form, this might be:
Name
Email address
Message
You may also require a phone number or service selection if it is necessary for your business process.
Avoid making optional information mandatory just because it is useful to have.
2. Open your form settings
In your website builder, CMS or form plugin, open the form editor.
Select the field you want to make mandatory and look for an option such as:
Required, Required field or This field is mandatory.
The exact setting depends on the platform you use.
3. Make the requirement clear
Visitors should be able to tell which fields are required before submitting the form.
Use an appropriate visual indicator, such as an asterisk, and provide a suitable explanation if necessary.
For example:
Name *
Email *
Phone
Message *
Make sure the indicator is not the only way the requirement is communicated where this could create an accessibility problem.
4. Add useful validation
Required fields should also check whether the information entered is suitable.
For example:
An email field should accept a valid email format.
A required text field should not accept an empty submission.
A required selection should require the visitor to choose an option.
Do not rely only on a visitor seeing the required-field indicator.
5. Test the form
Try submitting the form while leaving each required field empty.
The form should:
Prevent submission.
Identify the missing field.
Explain what needs to be provided.
Allow the visitor to correct the problem.
Then complete all required fields and confirm that the form submits successfully.

Salesforce

