Reputation: 471
I used contactform7 to create the contact form for a wordpress site. I want to reduce the rows in a textarea on that form for smaller screen sizes. Is there any method I can use using contactform7's own syntax? If not what are my options?
Below is the syntax for textarea in contactform7 btw.
[textarea* your-message 40x7]
(40 - cols, 7 - rows)
Upvotes: 45
Views: 265871
Reputation: 9334
Even though this question is more than 5yrs old, it is still active regularly, and like me many of us trying to get a clear answer to this question.
You can also type 10x
for cols and x2
for rows if you want to have only one attribute.
[textarea* your-message x3 class:form-control] <!-- only rows -->
[textarea* your-message 10x class:form-control] <!-- only columns -->
[textarea* your-message 10x3 class:form-control] <!-- both -->
Upvotes: 143
Reputation: 21
First create a form for your article and use this syntax
[textarea* your-message 40x7]
Upvotes: 2
Reputation: 1
You can try by adding additional css:
.master-cf7-0 .wpcf7 textarea{height:150px;}
Upvotes: 0
Reputation: 11
To add cols and rows, use x e.g. You need cols=80 and rows=5, it will be 80x5 It must be placed after the name of the control.
[textarea* your-message id:your-message 80x5]
Upvotes: 1
Reputation: 567
Code will be As below.
[textarea id:message 0x0 class:custom-class "Insert text here"]<!-- No Rows No columns -->
[textarea id:message x2 class:custom-class "Insert text here"]<!-- Only Rows -->
[textarea id:message 12x class:custom-class "Insert text here"]<!-- Only Columns -->
[textarea id:message 10x2 class:custom-class "Insert text here"]<!-- Both Rows and Columns -->
For Details: https://contactform7.com/text-fields/
Upvotes: 9
Reputation: 91
Add it after Placeholder attribute.
[textarea* message id:message class:form-control 40x7 placeholder "Message"]
Upvotes: 4
Reputation: 415
I was able to get this work. I added the following to my custom CSS:
.wpcf7-form textarea{
width: 100% !important;
height:50px;
}
Upvotes: 7
Reputation: 970
In the documentaion http://contactform7.com/text-fields/#textarea
[textarea* message id:contact-message 10x2 placeholder "Your Message"]
The above will generate a textarea with cols="10" and rows="2"
<textarea name="message" cols="10" rows="2" class="wpcf7-form-control wpcf7-textarea wpcf7-validates-as-required" id="contact-message" aria-required="true" aria-invalid="false" placeholder="Your Message"></textarea>
Upvotes: 28