textArea Dimensions on a form?

How can I add dimensions to this?

<?php echo $form->textArea($model, 'Details', array('maxlength' => 300)); ?>

I have tried multiple ways to add in array(‘rows’=>2, ‘cols’=>50) but nothing seems to work.

<?php echo $form->textArea($model, 'Details', array('maxlength' => 300, 'rows' => 6, 'cols' => 50)); ?>

You can also control the width and height of textarea using css.

Thanks this was something I tried and while inspecting css did not see anything overriding this. After a second look I found the css that was in fact overriding it. Thanks for the help.

One note: there is no “maxlength” attribute for text area. You can do it only with javascript ;)

andy_s, not sure what you mean here. When I define a maxlength on a textArea it does limit the inputs on my forms.


how do I display listing information using various textArea.

but I tried using foreach …

<?php echo $form->textArea($model, "ds_orientacao[]", array('style'=>'width: 570px; height: 80px;')); ?>