Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I change the form text box size?

Tags:

symfony

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

like image 966
whitebear Avatar asked Jun 03 '13 10:06

whitebear


People also ask

How do you change the size of the text box in HTML?

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.

How do I change the width of a text box?

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.

How do I reduce the size of a text box?

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.


1 Answers

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.

like image 82
Dani Sancas Avatar answered Oct 17 '22 11:10

Dani Sancas