- Posts: 8
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Different Maximum Value in Array (Numbers) for each column
- mforster
- Topic Author
- Offline
- New Member
Less
More
6 years 10 months ago #155003
by mforster
Different Maximum Value in Array (Numbers) for each column was created by mforster
Hello everybody,
I am actually building a Array with 3 column & 2 lines. I would like to put different Maximum Value on each column.
For example :
Answer Column 1 :1 => 10 ;
Answer Column 2 : 1=> 5 ;
Answer Column 3 : 1 => 8;
It is possible ? If not, is it possible to hide the unwanted answer ?
Thanks for your help
I am actually building a Array with 3 column & 2 lines. I would like to put different Maximum Value on each column.
For example :
Answer Column 1 :1 => 10 ;
Answer Column 2 : 1=> 5 ;
Answer Column 3 : 1 => 8;
It is possible ? If not, is it possible to hide the unwanted answer ?
Thanks for your help
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10635
- Thank you received: 3699
6 years 10 months ago #155013
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 Different Maximum Value in Array (Numbers) for each column
You can do that with a little JavaScript.
Assuming, for the sake of this example, x-scale question codes "X001", "X002" and "X003".
Set up your survey to use JavaScript and place the following script in the source of the question:
Sample survey attached:
Assuming, for the sake of this example, x-scale question codes "X001", "X002" and "X003".
Set up your survey to use JavaScript and place the following script in the source of the question:
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Column 2, remove all options greater than 5 $('#question{QID} select[id$="_X002"] option').filter(function( index ) { return $(this).val() > 5; }).remove(); // Column 3, remove all options greater than 8 $('#question{QID} select[id$="_X003"] option').filter(function( index ) { return $(this).val() > 8; }).remove(); }); </script>
Sample survey attached:
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: mforster
The topic has been locked.
- mforster
- Topic Author
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
6 years 10 months ago #155014
by mforster
Replied by mforster on topic Different Maximum Value in Array (Numbers) for each column
Perfect. Thank you for the quick answer !
The topic has been locked.