Can I add text labels to input fields?

Yes. You can use any HTML markup in a form template. Try using label element like this:

	Your Name
	[text* your-name]

You can also separate the label and form-tag. In this case, you need to add a for attribute to the label element. The for attribute value refers to the id option value in the associated form-tag:

<label for="namefield">Your Name</label>

[text* your-name id:namefield]

Pay attention when labeling checkboxes or radio buttons. A label element should not contain multiple form controls.

For example, you can’t do this (because this [checkbox] tag generates three checkboxes):

	Your Country
	[checkbox your-country "China" "India" "San Marino"]

Instead, use use_label_element:

[checkbox your-country use_label_element "China" "India" "San Marino"]

The default form template for Contact Form 7 does not use label elements anymore. I changed to the current form because we received tons of “bug reports” from users who misunderstood how to use the label element.

You can install another plugin called Contact Form 7: Accessible Defaults to get the default form template using label elements.

Just another contact form plugin for WordPress. Simple but flexible.

%d bloggers like this: