- Posts: 17
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to limit the long text answer' box to 1 row?
- AnnaSSSA
- Topic Author
- Offline
- New Member
Less
More
3 years 4 months ago #209768
by AnnaSSSA
How to limit the long text answer' box to 1 row? was created by AnnaSSSA
Dear All, I need to limit to 1 row the answer' box of the long type questions. I see only the option to limit the number of rows to see or the characters' number...nothing more. Of course, I'm missing to see function that make possible to activate this limitation.
My survey is already running online, and I can do only the changes admitted in this stage.
Thanks.
Anna
My survey is already running online, and I can do only the changes admitted in this stage.
Thanks.
Anna
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13677
- Thank you received: 2496
3 years 4 months ago #209770
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic How to limit the long text answer' box to 1 row?
Did you try with row : 1 in advanced setting ?
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- AnnaSSSA
- Topic Author
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 4 months ago #209771
by AnnaSSSA
Replied by AnnaSSSA on topic How to limit the long text answer' box to 1 row?
I am unable to see this section within the question's page...is it somewhere else?
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11681
- Thank you received: 2748
3 years 4 months ago #209772
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
Replied by holch on topic How to limit the long text answer' box to 1 row?
Wouldn't this make it basically the short text question type?!I need to limit to 1 row the answer' box of the long type questions.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- AnnaSSSA
- Topic Author
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 4 months ago #209773
by AnnaSSSA
Replied by AnnaSSSA on topic How to limit the long text answer' box to 1 row?
I completely agree with you... but I am trying to remedy to a wrong setting of the question we did.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12997
- Thank you received: 3999
3 years 4 months ago #209774
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to limit the long text answer' box to 1 row?
Hi,
unfortunately you did not mention the LimeSurvey version you are using.
As the user interface changed with each new major version we can't show you the exact place.
But in version 3.x. you find it here:
"Display":
Version 2.50/2.73 in "Advanced settings"
unfortunately you did not mention the LimeSurvey version you are using.
As the user interface changed with each new major version we can't show you the exact place.
But in version 3.x. you find it here:
"Display":
Version 2.50/2.73 in "Advanced settings"
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- AnnaSSSA
- Topic Author
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 4 months ago #209775
by AnnaSSSA
Replied by AnnaSSSA on topic How to limit the long text answer' box to 1 row?
I'm using a version 3.x and I confirm to see the Display row setting. I used it but it allows to reduce the number of rows to see, not the number of rows that can be filled. Of course this solution can help me to discourage extensive compilation.
Thanks for your support!
Thanks for your support!
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10116
- Thank you received: 3597
3 years 4 months ago #209778
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic How to limit the long text answer' box to 1 row?
You can add this script to the question source. It will will hide the long textarea and insert a short text input. Values entered in that text input will be loaded into the hidden textarea.
Sample survey attached:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); // Hide the textarea $('.answer-item textarea', thisQuestion).hide(); // Insert short text input $('.answer-item', thisQuestion).append('<input class="form-control inserted-input" type="text">'); $('.inserted-input', thisQuestion).val($('.answer-item textarea:eq(0)', thisQuestion).val()); // Listener on inserted input $('.inserted-input', thisQuestion).on('keyup change', function(i) { $('.answer-item textarea', thisQuestion).val($(this).val()).trigger('change'); }); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- AnnaSSSA
- Topic Author
- Offline
- New Member
Less
More
- Posts: 17
- Thank you received: 0
3 years 4 months ago #209786
by AnnaSSSA
Replied by AnnaSSSA on topic How to limit the long text answer' box to 1 row?
Great, thanks!
With a script I can transform the long text question in a Yes/No question?
With a script I can transform the long text question in a Yes/No question?
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12997
- Thank you received: 3999
3 years 4 months ago #209788
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to limit the long text answer' box to 1 row?
Hi,
please do not forget:
all types of "text" questions (short, long, huge) have the same underlying data type in the MySQL database ("text", that is 65000 characters).
This means, I can enter in a short text field the same amont of characters as in the other.
As you see here
If you really want to limit the length of the answer you have to validate, like strlen(self) le 300
Joffm
please do not forget:
all types of "text" questions (short, long, huge) have the same underlying data type in the MySQL database ("text", that is 65000 characters).
This means, I can enter in a short text field the same amont of characters as in the other.
As you see here
If you really want to limit the length of the answer you have to validate, like strlen(self) le 300
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13677
- Thank you received: 2496
3 years 4 months ago #209794
by DenisChenu
You can keep previous value with VV export/import or directly by deactivated table …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic How to limit the long text answer' box to 1 row?
Sometimes : best is to deactivate your survey temporary …AnnaSSSA wrote: Great, thanks!
With a script I can transform the long text question in a Yes/No question?
You can keep previous value with VV export/import or directly by deactivated table …
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.