Text input fields are the most common factors of a contact form. As you may know, HTML has two types of elements for text input fields: <input type="text" />Â for a single-line input; and <textarea>Â for multi-line input.
Â
Contact Form 7 provides several types of form tags for representing these two types of HTML elements: text; text*; email; email*; tel; tel*; url; url*; textarea; and textarea*. In this article, I will show you detailed information about the usage and semantics of these form tags.
Â
Both text and text* are used for single-line input and accept any form of text. The difference between them is that text* connotes a required field. In Contact Form 7’s convention, all types of tags with an asterisk ‘*’ mean that these are required fields.
Â
Available options for text and text*
Â
| OPTION | EXAMPLES | DESCRIPTION | 
|---|---|---|
| (size)/(maxlength) | 40/100 20/ /50 | Field size and max length. You can omit one of them. | 
| id:(id) | id:foo | id attribute value of the input element. | 
| class:(class) | class:bar | class attribute value of the input element. To set two or more classes, you can use multiple class: option, like [text your-text class:y2008 class:m01 class:d01]. | 
| tabindex:(num) | tabindex:10 | tabindex attribute value of the input element. | 
| akismet:author | Â | Options for using Akismet. | 
| placeholder watermark | Â | Use the value as placeholder text instead of as default value. watermark works as an alias of placeholder | 
| default:user_login default:user_first_name default:user_last_name default:user_nickname default:user_display_name | Â | Options for retrieving logged-in user info as default value of field. | 
Â
These fields can have a zero or one value, and the value will be used as the default value of the input field.
Â
Example:
Â

