- Posts: 9
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
default value in a "Array (Numbers)"-type question
- noyrb
- Topic Author
- Offline
- New Member
Less
More
7 years 9 months ago #137532
by noyrb
default value in a "Array (Numbers)"-type question was created by noyrb
Hi,
Is there a possibility to assign a default value of 0 for all elements in a "Array (Numbers)"-type question?
I'm using LimeSurvey: Version 2.50+ Build 160603.
Is there a possibility to assign a default value of 0 for all elements in a "Array (Numbers)"-type question?
I'm using LimeSurvey: Version 2.50+ Build 160603.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3698
7 years 9 months ago #137557
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 default value in a "Array (Numbers)"-type question
Are you using drop-down or text input mode?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- noyrb
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 1
7 years 9 months ago #137576
by noyrb
Replied by noyrb on topic default value in a "Array (Numbers)"-type question
I'm using the text input mode
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3698
7 years 9 months ago #137598
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 default value in a "Array (Numbers)"-type question
Set up your survey to use JavaScript
and place this script in the array question source.
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#question{QID} input.text').each(function(i) { if($(this).val() == '') { $(this).val(0); fixnum_checkconditions(this.value, this.name, this.type); } }); }); </script>
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: noyrb
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
7 years 9 months ago - 7 years 9 months ago #137626
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 default value in a "Array (Numbers)"-type question
Another solution, without javascript.
Add an Equation question type at start of your survey and set the value (if it's empty) for each of you sub question
...
Add an Equation question type at start of your survey and set the value (if it's empty) for each of you sub question
Code:
{QCODE_SQ001_SQ001=if(is_empty(QCODE_SQ001_SQ001.NAOK),"0",QCODE_SQ001_SQ001.NAOK)} {QCODE_SQ001_SQ002=if(is_empty(QCODE_SQ001_SQ002.NAOK),"0",QCODE_SQ001_SQ002.NAOK)}
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.
Last edit: 7 years 9 months ago by DenisChenu. Reason: ) : sifflote:
The following user(s) said Thank You: holch, tpartner, noyrb
The topic has been locked.
- fabcan
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
7 years 9 months ago - 7 years 9 months ago #137640
by fabcan
Replied by fabcan on topic default value in a "Array (Numbers)"-type question
Hi Guys I have a question.
So I need an array from 1 to 6 and other 7th option with a write. Can I do that?
E.g.
Not true.............................................................Absolutly True........ .......I dont care
1...................... 2.............. 3............ 4............5............6................................O
Thank you so much
So I need an array from 1 to 6 and other 7th option with a write. Can I do that?
E.g.
Not true.............................................................Absolutly True........ .......I dont care
1...................... 2.............. 3............ 4............5............6................................O
Thank you so much
Last edit: 7 years 9 months ago by fabcan.
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
7 years 9 months ago #137647
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 default value in a "Array (Numbers)"-type question
This seems to be a totally different question.
And I am not too sure what you are trying to do. What do you mean with "with a write"?
Make a screenshot/image, your ASCII art won't work here in the forum, as the font used is not fixed width.
I assume that you want a scale from 1-6 plus "I don't care", This is quite simple. You can create your custom scale.
For the texts with code 1 and 6 you just put something like this into the box for the answer option.
And I am not too sure what you are trying to do. What do you mean with "with a write"?
Make a screenshot/image, your ASCII art won't work here in the forum, as the font used is not fixed width.
I assume that you want a scale from 1-6 plus "I don't care", This is quite simple. You can create your custom scale.
For the texts with code 1 and 6 you just put something like this into the box for the answer option.
Code:
Not true<br/>1
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
The topic has been locked.
- fabcan
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
7 years 9 months ago #137650
by fabcan
Replied by fabcan on topic default value in a "Array (Numbers)"-type question
thank you so much.
But how can I create a new array with likert scale from 1 to 6 plus "O" with label too?
Look at the picture.
Thank you in advance
But how can I create a new array with likert scale from 1 to 6 plus "O" with label too?
Look at the picture.
Thank you in advance
Attachments:
The topic has been locked.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11758
- Thank you received: 2753
7 years 9 months ago #137652
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 default value in a "Array (Numbers)"-type question
That is what I explained to you above. You use the normal array type question and as answer option you will create 1,2,3,4,5,6,0.
When you want text above the number, like for 1, 6 and 0 you adapt the code I gave you. The < br > tag will create a line break.
When you want text above the number, like for 1, 6 and 0 you adapt the code I gave you. The < br > tag will create a line break.
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.
- fabcan
- Offline
- Junior Member
Less
More
- Posts: 32
- Thank you received: 0
7 years 9 months ago #137760
by fabcan
Replied by fabcan on topic default value in a "Array (Numbers)"-type question
Thank you so much for your answer.
I did that and I fixed in part becasue the program is puting the label only in the first row.
I need to have a number label (1,2,3,4,5,6,0) in each row and not only in the first one. This because I have lot of items and after the 5th one people can't know which answer is linked to the number.
So I need to have for each row the numbers at least.
Thank you in advances
I did that and I fixed in part becasue the program is puting the label only in the first row.
I need to have a number label (1,2,3,4,5,6,0) in each row and not only in the first one. This because I have lot of items and after the 5th one people can't know which answer is linked to the number.
So I need to have for each row the numbers at least.
Thank you in advances
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3698
7 years 9 months ago #137761
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 default value in a "Array (Numbers)"-type question
Repeating headings in array questions every X subquestions -
manual.limesurvey.org/Global_settings#Presentation
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: fabcan
The topic has been locked.