Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: set box text input width for other

set box text input width for other 5 years 7 months ago #49594

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 administrator has disabled public write access.

set box text input width for other 5 years 7 months ago #49597

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5881
  • Thank you received: 1286
  • Karma: 519
Add the following to the end of template.css:
.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 administrator has disabled public write access.

set box text input width for other 5 years 7 months ago #49605

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 administrator has disabled public write access.

set box text input width for other 5 years 7 months ago #49606

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5881
  • Thank you received: 1286
  • Karma: 519
No, that ones set up a little differently:
.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 administrator has disabled public write access.

set box text input width for other 5 years 7 months ago #49607

You are a genius!
The administrator has disabled public write access.

set box text input width for other 5 years 7 months ago #49644

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5964
  • Thank you received: 363
  • Karma: 259
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50203

  • brydon
  • brydon's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
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 administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50215

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5881
  • Thank you received: 1286
  • Karma: 519
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 administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50530

  • brydon
  • brydon's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
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 administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50549

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5881
  • Thank you received: 1286
  • Karma: 519
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 administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50676

  • brydon
  • brydon's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
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 ):
<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]) && $_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.
 if (isset($maxselectlength) && $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: 5 years 7 months ago by brydon.
The administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50680

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5964
  • Thank you received: 363
  • Karma: 259
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50709

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5881
  • Thank you received: 1286
  • Karma: 519
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 administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50745

  • brydon
  • brydon's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
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:
.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 administrator has disabled public write access.

Any reason this would not work? 5 years 7 months ago #50764

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5881
  • Thank you received: 1286
  • Karma: 519
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 administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.249 seconds