Page 1 of 1

Module Questions - changing the text area width in the form

Posted: Mon Jul 02, 2007 9:17 am
by ullal
I want to be able to change the width of the text area in the questions form in a flexible way i.e. depending on the resolution of the display monitor = available width of the content area.

I have found a way to change the width in a fixed way by modifying the lines 67-68 of the file function.default_form.php from

$smarty->assign('input_question',
  $this->CreateTextArea(false,$id,'','input_question'));

to

$textareawidt = 50;
$smarty->assign('input_question',
  $this->CreateTextArea(false,$id,'','input_question','','','','',$textareawidt));

I have set the width to a fixed value of 50 columns. This is based on the position of the parameter width in the definition of the function CreateTextArea in class.module.inc.php in which a preset value of 80 columns is used.

Is there any way to set the value of the variable $textareawidt? Is there any Smarty or CMS variable available that I could use to set this width?

Re: Module Questions - changing the text area width in the form

Posted: Mon Jul 02, 2007 10:26 am
by cyberman
I think the easier way would be to style the width via CSS - you have only to add a class or id in template file :).

Re: Module Questions - changing the text area width in the form

Posted: Wed Sep 24, 2008 8:40 am
by zgr
But how with CSS in this case???

Re: Module Questions - changing the text area width in the form

Posted: Wed Sep 24, 2008 1:44 pm
by cyberman
Make a look at the html source and find out if the textarea has an id (for instance "example").

Then you can use

Code: Select all

textarea#example {width: 30em;}
to format it.

Re: Module Questions - changing the text area width in the form

Posted: Thu Sep 25, 2008 7:03 am
by zgr
There is no ID for the module-generated textarea.

But cascade from parent works fine:

Code: Select all

<td id="tapatch">{$input_question}</td>

Code: Select all

#tapatch textarea {width:100%;}