Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

setting a 'col' value in userforms v0.2.1


Go to End


5 Posts   1989 Views

Avatar
MattyJ

Community Member, 11 Posts

9 June 2010 at 10:54pm

Hi,
I can't seem to find where to specify the 'cols' width of a <textarea> in userforms module. Rows is easy as it's in the user interface, but cols I cannot find. What file do I need to edit in the userforms module (seems to be stuck at cols='20').
Thanks
Matt

Avatar
_Vince

Community Member, 165 Posts

10 June 2010 at 11:35am

I think you have to edit form.css for whatever theme you are using. The input and the middleColumn values and whatever else constrains the size.

You can probably find any additional stuff to edit by looking at the page with Firebug.

Avatar
MattyJ

Community Member, 11 Posts

22 June 2010 at 8:57pm

cheers, none of those values seem to make a difference to the col width though. In firebug I can edit the HTML cols value below and that does the trick, but still can't find where this value is set within userforms?

<textarea cols="20" rows="6" name="EditableTextField9" class=" requiredField" id="Form_Form_EditableTextField9"></textarea>

Avatar
planetbrain

Community Member, 12 Posts

22 October 2010 at 1:51am

Was a solution to this ever found.
I've just ran into the same problem and would like to change the col value if possibler.

Avatar
Sherry

Community Member, 4 Posts

29 October 2010 at 7:06pm

I had to remove the textarea width setting in the theme's style.css. (I guess re-ordering the style sheets such that the form stylesheet comes after the style stylesheet in the .ss would work as well). That allowed the textarea width in the form.css to be applied.

Or removing textarea width in both stylesheets and set the col width parm to return new TextareaField($this->Name, $this->Title, $this->getSetting('Rows'), COLWIDTHHERE); in the userforms editabletextfield.php worked for me, also.