Quantcast
Channel: Topics in Category: Can I do this with LimeSurvey? - LimeSurvey forums
Viewing all articles
Browse latest Browse all 17529

Different Maximum Value in Array (Numbers) for each column - by: tpartner

$
0
0
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:

<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:

File Attachment:

File Name: limesurvey_survey_214844_2017-05-18-2.lss
File Size: 17 KB

Viewing all articles
Browse latest Browse all 17529

Trending Articles