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:
ÂÂ