Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

set box text input width for other

  • vickibellamy
  • vickibellamy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #49594 by vickibellamy
set box text input width for other was created by vickibellamy
Hi there,

Is it possible to set the box text input width for other in a radio list, I have looked
into attributes and cant see it there as I know this is possible with a simple text input field.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #49597 by tpartner
Replied by tpartner on topic set box text input width for other
Add the following to the end of template.css:
Code:
.list-radio li.other input.text {
    width: 300px;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • vickibellamy
  • vickibellamy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #49605 by vickibellamy
Replied by vickibellamy on topic set box text input width for other
thanks this works brilliant, so if I would like to apply the same to a multiple option question so that the option text field is 300px surely this would be the css to add?

.multiple-opt li.other input.text {
width: 550px;
}

doesnt seem to work though :(
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 6 months ago #49606 by tpartner
Replied by tpartner on topic set box text input width for other
No, that ones set up a little differently:
Code:
.multiple-opt input.text {
    width: 550px;
}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • vickibellamy
  • vickibellamy's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 6 months ago #49607 by vickibellamy
Replied by vickibellamy on topic set box text input width for other
You are a genius!
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 5 months ago #49644 by Mazi
Replied by Mazi on topic set box text input width for other
You're welcome!

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
13 years 5 months ago #50203 by brydon
Replied by brydon on topic Any reason this would not work?
I added this code to the end of template.css in the active template directory. I checked the page source and it is pointing to the right template.css file. But alas, no change to the width of the "other" input box.

Anyone else have problems with this? Any help would be appreciated.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 5 months ago #50215 by tpartner
Replied by tpartner on topic Any reason this would not work?
brydon, what question type are you using?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
13 years 5 months ago #50530 by brydon
Replied by brydon on topic Any reason this would not work?
The question type is "List (radio)"

The last few lines of template.css in the relevant template directory are:
.list-radio li.other input.text {
width: 300px;
}
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 5 months ago #50549 by tpartner
Replied by tpartner on topic Any reason this would not work?
Can you activate a sample survey so we can check to see what is interfering?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
13 years 5 months ago - 13 years 5 months ago #50676 by brydon
Replied by brydon on topic Any reason this would not work?
Okay, thanks for taking an interest in my problems!

I have set up two sample surveys to illustrate a few issues. The version for both is limesurvey190plus-build9160-20100929:

The first survey is at areaf.rdos.bc.ca/foo/index.php?sid=95218&lang=en . It is built on the "Basic" template that shipped with the above-noted LimeSurvey package. There are three issues:

First, the label for the comment is wonky. I fix this in qanda.php by adding a break near line 2378 (denoted with ):
Code:
<p class="comment">
    <label for="answer'.$ia[1].'comment">'.$hint_comment.':[b]<BR>[/b]</label>
 
    <textarea class="textarea" name="'.$ia[1].'comment" id="answer'.$ia[1].'comment" rows="'.floor($tarows).'" cols="50" >';
        // --> END NEW FEATURE - SAVE
        if (isset($_SESSION[$fname2]) &amp;&amp; $_SESSION[$fname2])
        {
            $answer .= str_replace("\\", "", $_SESSION[$fname2]);
        }
        $answer .= '</textarea>
</p>

Second, my original problem is an "other" box that is unresponsive to changes in template.css. In this example, the text box resizes appropriately to 500px. So I am thinking the problem must be with my other template.

Third, a minor quibble with the ranking tool. The "receiving" text boxes on the right do not resize properly. It is not much of an issue in this example but is a real problem when the items are much longer (most of the text is truncated).

I fix this by changing qanda.php by adding the "bolded" line below (it is missing in the original qanda.php). I am not sure why it is missing--without it no sizing occurs.
Code:
 if (isset($maxselectlength) &amp;&amp; $maxselectlength > 60)
    {
        $ranklist = str_replace("<input class=\"text\"", "<input size='60' class='text'", $ranklist);
        $answer .= "</tr>\n<tr>\n"
        . "\t<td align='left' class='output'>\n"
        . "\t<table border='0' cellspacing='1' cellpadding='0'>\n"
        . "\t<tr><td></td><td><strong>".$clang->gT("Your Ranking").":</strong></td></tr>\n";
    }
    else
    {
    [b]$ranklist = str_replace("<input class=\"text\"", "<input size='" . $maxselectlength . "' class='text'", $ranklist);[/b]
        $answer .= "\t<td style=\"text-align:left; white-space:nowrap;\" class=\"rank output\">\n"
        . "\t<table border='0' cellspacing='1' cellpadding='0'>\n"
        . "\t<tr><td></td><td><strong>".$clang->gT("Your Ranking").":</strong></td></tr>\n";
    }

The second survey is at: areaf.rdos.bc.ca/foo/index.php?sid=27546&lang=en

It is identical except that it uses a template I have had kicking around for a year or two. The template is based on "Basic". The second survey has all the problems of the first except that the "other" box for the list is unresponsive to changes in template.css.

Any help would be greatly appreciated.
/M
Last edit: 13 years 5 months ago by brydon.
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
13 years 5 months ago #50680 by Mazi
Replied by Mazi on topic Any reason this would not work?
I recommedn to re-build your customized templatze from scratch, based on the current basic template. There seem to be quite a few changes which lead to missing identifiers so that the additional code in template.css is no working correctly.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose