Welcome to the LimeSurvey Community Forum

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

set box text input width for other

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.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 5 months ago #50709 by tpartner
Replied by tpartner on topic Any reason this would not work?
1) This is not a bug but a matter of preference. You should be able to reposition the <p> that contains the textarea with CSS by removing the float style.

2) This may be a bug. Please open a ticket at the bugtracker and include a sample survey and your fix.

3) Mazi is correct - your template generates some 20 odd HTML errors that need to be cured. I also recommend starting anew with the current Basic template.

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 #50745 by brydon
Replied by brydon on topic Any reason this would not work?
Yes, thanks, I have migrated to a new template based on the most recent version of "Basic". This solves the original problem with the "other" field (listed as #3 in previous posts).

I have also submitted the Ranking-resize issue (#2) to the bug tracker.

I still am not completely sure about the fix for my first problem (the floating label; #1). I am afraid I am a survey designer/researcher, not a developer, and don't really understand the details of CSS. Do you mean I should take the float out of:
Code:
.list-with-comment p.comment {
  margin: 0%;
  padding: 0.5em;
  text-align: left;
  float: left;
  width: 47%;
}

in template.css?

Thanks for any pointers in the right direction...
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
13 years 5 months ago #50764 by tpartner
Replied by tpartner on topic Any reason this would not work?
Yup, remove the "float: left;" and "width: 47%;". You'll also need to do the same to .list-with-comment div.list.

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
7 years 10 months ago #135953 by rolandcyrillo
Replied by rolandcyrillo on topic set box text input width for other
Please, how do I do to put lines in the box "other" in multiple option? I changed to 300px in the CSS, but it still have a single line and the person who is answering cannot see all the inputed text.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 10 months ago #135959 by tpartner
Replied by tpartner on topic set box text input width for other
There is no way to change that from a text input to a textarea.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: rolandcyrillo
The topic has been locked.
More
5 years 8 months ago #171782 by terryaulenbach
Replied by terryaulenbach on topic set box text input width for other
Is it also possible to somehow apply this to only one particular "other" text box rather than to all of them? I.e can a custom class be set up that can somehow be applied just to the "other" option in a multiple choice question?
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #171784 by Joffm
Replied by Joffm on topic set box text input width for other
Hi,
this thread started 7 years ago.
Probably LS version 1.92 or so.

I think you are using a newer version, but which one?

For version 3.13.2. I can show this:
Enter in the question text (source code mode:
Code:
<style type="text/css">.form-control {
    width: 500px !important;
}
</style>

Play around with the width to your needs.


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 8 months ago #171785 by tpartner
Replied by tpartner on topic set box text input width for other
LimeSurvey version?

Do you want to apply it to all multiple-choice questions?

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
5 years 8 months ago #171791 by terryaulenbach
Replied by terryaulenbach on topic set box text input width for other
Thank you very much. This is exactly what I needed.
The topic has been locked.
More
5 years 8 months ago #171792 by terryaulenbach
Replied by terryaulenbach on topic set box text input width for other
Thanks, Tony, but Joffm answered my question.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose