I make form in Controller
like this below.
$form = $this->createFormBuilder($row)
->add('comment',null,array('label' => 'input comment'))
then in the twig file...
{{form_widget(form.commentToMutor)}}
It shows text input box,but it is too small.
How to change size of TextBox
If you simply want to specify the height and font size, use CSS or style attributes, e.g. //in your CSS file or <style> tag #textboxid { height:200px; font-size:14pt; } <! --in your HTML--> <input id="textboxid" ...> Save this answer.
On the Layout tab in the Textbox Width field you can adjust the textbox width. The default width for Textboxes is 20 characters. By specifying a value larger or smaller than 20 you can increase or decrease the width of the Textbox.
Click anywhere in the text. On the Text Box Tools Format tab, in the Text group, click Text Fit, and do one of the following: To reduce the point size of text until there is no text in overflow, click Shrink Text On Overflow. To shrink or expand text to fit in the text box when you resize the box, click Best Fit.
Extending @manseuk 's answer (I don't have enough reputation to post a comment), you can also specify the html style attribute inside the form builder, if you preffer:
$form = $this->createFormBuilder($row)
->add('comment', null, array(
'label' => 'input comment',
'attr' => array('style' => 'width: 200px')
)
);
Edited from html attribute for width
to html style attribute
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With