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

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

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

Post 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
Last edited by Anonymous on Mon Aug 04, 2008 7:21 am, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Set width of form in Questions and Answers module

Post by Dr.CSS »

I don't have it installed so a link would help or the output of the rendered page...
nils73
Power Poster
Power Poster
Posts: 520
Joined: Wed Sep 08, 2004 3:32 pm

Re: Set width of form in Questions and Answers module

Post 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
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

Re: Set width of form in Questions and Answers module

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Set width of form in Questions and Answers module

Post 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...
Andrew Prior
Forum Members
Forum Members
Posts: 247
Joined: Sun Oct 28, 2007 4:14 am

Re: Set width of form in Questions and Answers module

Post by Andrew Prior »

Ok, just had a learning experience. Thanks Mark, now understand what you are saying, and it works. Thanks.
Last edited by Anonymous on Mon Aug 04, 2008 7:20 am, edited 1 time in total.
Post Reply

Return to “CMSMS Core”