Page 1 of 1

[Solved] Set width of form in Questions and Answers module

Posted: Sat Aug 02, 2008 1:02 pm
by Andrew Prior
In Calguy's Questions module there is this code for the question template:

Code: Select all

<!-- Start Questions Form Template -->
{if isset($error)}<strong><font color="red">{$error}</font></strong>{/if}
{if isset($message)}<strong><font color="blue">{$message}</font></strong>{/if}
{$formstart}
<table>
<tr><td >{$prompt_author} </td><td>{$input_author}</td>
<tr ><td >{$prompt_question}</td><td>{$input_question}</td>
{if isset($image_captcha)}
<tr><td >{$prompt_captcha}</td><td>{$image_captcha}</td>
<tr><td > </td><td>{$input_captcha}</td>
{/if}
<tr><td> </td><td>{$submit}</td>
</table>
{$formend}
<!-- End Questions Form Template -->
Where can I change the width of the {$input_question} field.  It makes no difference if I set the table or cells width, so obviously something outside my ken is happening.
Thanks
Andrew

Re: Set width of form in Questions and Answers module

Posted: Sat Aug 02, 2008 9:26 pm
by Dr.CSS
I don't have it installed so a link would help or the output of the rendered page...

Re: Set width of form in Questions and Answers module

Posted: Sat Aug 02, 2008 9:41 pm
by nils73
You'd best style it with CSS. For example:

Code: Select all

form { width: 400px; }
This will do in all browsers. Just make sure you have this in your CSS.

Regards,
Nils

Re: Set width of form in Questions and Answers module

Posted: Mon Aug 04, 2008 5:49 am
by Andrew Prior
Mark and Nils,
You can see a quick and dirty example at
http://scotschurch.org/churchrewired/in ... e=question

You can see it pushes down to the bottom of the page here, as it is too wide- scroll right down or you won't see it.
The tag that seems to be the problem is {$input_question} which I cannot resize. I can't find where Calguy has set the size to this; I've wrapped it in a Div and also tried to size the table cells, but no go.
Andrew

Re: Set width of form in Questions and Answers module

Posted: Mon Aug 04, 2008 6:15 am
by Dr.CSS
So you look in the page source to find any identifying IDs or classes close to it to target, and I found the form has an ID, <form id="m6moduleform_2", so...

#m6moduleform_2 textarea{width:50%}    The number can be what you want...

Re: Set width of form in Questions and Answers module

Posted: Mon Aug 04, 2008 6:16 am
by Andrew Prior
Ok, just had a learning experience. Thanks Mark, now understand what you are saying, and it works. Thanks.