Welcome to the LimeSurvey Community Forum

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

Is it possible to increase the field size for multiple short texts?

  • Dezember
  • Dezember's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 9 months ago #239947 by Dezember
Please help us help you and fill where relevant:
Your LimeSurvey version: [see right hand bottom of your LimeSurvey admin screen]
Own server or LimeSurvey hosting:
Survey theme/template:
==================
I have  LimeSurvey Community Edition  Version 5.4.7. I have multiple short texts with three fields and I want to increase the size of the third field. Is this possible? Or is it possible to make it at least resizable? 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #239957 by Joffm
Hi,
I did it with this javascript snippet:
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:complete',function()    {
  $('#question{QID} input:eq(0).form-control').css({ 'width':'20%' });
  $('#question{QID} input:eq(1).form-control').css({ 'width':'60%' });
  $('#question{QID} input:eq(2).form-control').css({ 'width':'40%' });
  $('#question{QID} input:eq(3).form-control').css({ 'width':'80%' });
});
</script>



In my opinion there should be a plain css solution, but I did not find it.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago - 1 year 9 months ago #239965 by tpartner

In my opinion there should be a plain css solution, but I did not find it.

There is:

Code:
<style type="text/css" data-author="Tony Partner">
 
#question{QID} li.answer-item:nth-child(1) .form-control { width: 20%; }
#question{QID} li.answer-item:nth-child(2) .form-control { width: 60%; }
#question{QID} li.answer-item:nth-child(3) .form-control { width: 40%; }
#question{QID} li.answer-item:nth-child(4) .form-control { width: 80%; }

</style>

Sample survey attached: 

File Attachment:

File Name: limesurvey...9551.lss
File Size:37 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 1 year 9 months ago by tpartner.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #239982 by Joffm
I missed the "nth-child". Instead I tried "eq()" without success.

Thanks, Tony

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Dezember
  • Dezember's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
1 year 9 months ago #239983 by Dezember
Thank you very much!
But is it possible to extend it not horizontally, but vertically?

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago - 1 year 9 months ago #240000 by Joffm
Sorry,
please read the manual about question types.
This is a built in setting.
 
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 9 months ago by Joffm.
The following user(s) said Thank You: Dezember

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose