Welcome, Guest
Username: Password: Remember me

TOPIC: fill ranking array with answers from previous question

Re: fill ranking array with answers from previous question 3 years 4 months ago #59842

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4130
  • Thank you received: 763
  • Karma: 347
Can that to?
Yes, replace the script in the source of the multiple-options on that page with the following. Replace "MM" with the ID of the multiple options question (375) and "NN" with the ID of the multiple-numeric question (402). Note that the call for the "calculateValue" function is specific to your demo survey and would need to be modified for other surveys/groups/questions.
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		handleChecked3(MM, NN);
 
		function handleChecked3(q1ID, q2ID) {
 
			// Hide Q1
			$('#question'+q1ID+'').hide();
 
			// Loop through all hidden Q1 options
			$('#question'+q1ID+' li[id^="javatbd"]:hidden').each(function(i) {
 
				// Find the answer value
				var ansTxt = $('label', this).text();
 
				// Find the corresponding list item in Q2
				var el = $('#question'+q2ID+' label[for^="answer"]').filter(function(){return $(this).text() == ansTxt;}).parent('li:eq(0)');
 
				// Hide the corresponding list item in Q2
				$(el).hide();
 
				// Set the corresponding input in Q2 to 0
				$('input.text', el).val(0);
 
			});
 
			// Calculate for sum amount
			calculateValue68179X12X402(3) // NOTE: this needs to use local survey, group and q2 question IDs
		}
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 3 years 4 months ago #59873

Sorry. Did it. List keeps blank. This is the source code of the page. I've put the JS in the multiple numeric question. Tried it in the multiple options page but without result.
===============================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml" xml:lang="nl" lang="nl">
<head>
<link rel="stylesheet" type="text/css" media="all" href="survey.wwavdata.nl/limesurvey/scripts/jq.../start/jquery-ui.css" />
<link rel="stylesheet" type="text/css" media="all" href="survey.wwavdata.nl/limesurvey/scripts/jq...rt/lime-progress.css" />
<script type="text/javascript" src="survey.wwavdata.nl/limesurvey/scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="survey.wwavdata.nl/limesurvey/scripts/jquery/jquery-ui.js"></script>
<link href="survey.wwavdata.nl/limesurvey/scripts/jq.../start/jquery-ui.css" media="all" type="text/css" rel="stylesheet" /><link href="survey.wwavdata.nl/limesurvey/scripts/jq...rt/lime-progress.css" media="all" type="text/css" rel="stylesheet" /><script type="text/javascript" src="survey.wwavdata.nl/limesurvey/scripts/jquery/jquery-ui.js"></script>

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>A SURVEY: Nederlands Hartstichting meting 2 - 2009</title>

<meta name="generator" content="LimeSurvey www.limesurvey.org" />

<!-- The following line includes template.css and if an RTL-language is used template-rtl.css -->
<link rel='stylesheet' type='text/css' href='survey.wwavdata.nl/limesurvey/upload/tem...ss_grey/template.css' />


<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="survey.wwavdata.nl/limesurvey/upload/tem...ss_grey/ie_fix_6.css" />
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="survey.wwavdata.nl/limesurvey/upload/tem...ss_grey/ie_fix_7.css" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="survey.wwavdata.nl/limesurvey/upload/tem...ss_grey/ie_fix_8.css" />
<![endif]-->

<!-- The following CSS hides visual elements of the progress bar from screen readers. -->

<style type="text/css" media="aural tty">
progress-graph .zero, progress-graph .graph, progress-graph .cent { display: none; }
</style>

<script type="text/javascript" src="survey.wwavdata.nl/limesurvey/upload/tem...ess_grey/template.js"></script>
<link rel="shortcut icon" href="survey.wwavdata.nl/limesurvey/upload/tem...ess_grey/favicon.ico" />
<script type="text/javascript" src="survey.wwavdata.nl/limesurvey/scripts/survey_runtime.js"></script>
</head>
<body>
<div class="surveyBorder">
<form method='post' action='survey.wwavdata.nl/limesurvey/index.php' id='limesurvey' name='limesurvey' autocomplete='off'>
<!-- INPUT NAMES -->

<input type='hidden' name='fieldnames' value='68179X12X3751|68179X12X3752|68179X12X3753|68179X12X3754|68179X12X3755|68179X12X3756|68179X12X3757|68179X12X3758|68179X12X3759|68179X12X37510|68179X12X37511|68179X12X37512|68179X12X37513|68179X12X37514|68179X12X37515|68179X12X37516|68179X12X37517|68179X12X37518|68179X12X37519|68179X12X37520|68179X12X37521|68179X12X37522|68179X12X37523|68179X12X37524|68179X12X37525|68179X12X37526|68179X12X4021|68179X12X4022|68179X12X4023|68179X12X4024|68179X12X4025|68179X12X4026|68179X12X4027|68179X12X4028|68179X12X4029|68179X12X40210|68179X12X40211|68179X12X40212|68179X12X40213|68179X12X40214|68179X12X40215|68179X12X40216|68179X12X40217|68179X12X40218|68179X12X40219|68179X12X40220|68179X12X40221|68179X12X40222|68179X12X40223|68179X12X40224|68179X12X40225|68179X12X40226' id='fieldnames' />
<table class="surveyWrapper">
<tr>
<td>
<table width="100%" cellspacing="0">
<tr>
<td class="graph">
<script type="text/javascript">
$(function() {
$("#progressbar").progressbar({
value: 36
});
});
</script>

<div id="progress-wrapper">

<span class="hide">U heeft 36% van deze vragenlijst ingevuld</span>
<div id="progress-pre">0%</div>
<div id="progressbar"></div>
<div id="progress-post">100%</div>
</div>
</td>
</tr>

<tr>
<td align="center">

</td>
</tr>
</table>
<input type='text' id='runonce' value='0' style='display: none;'/>
<!--JavaScript FOR CONDITIONAL QUESTIONS -->
<script type='text/javascript'>
<!--
function noop_checkconditions(value, name, type)
{
}

function checkconditions(value, name, type)
{
if (type == 'radio' || type == 'select-one')
{
var hiddenformname='java'+name;
document.getElementById(hiddenformname).value=value;
}

if (type == 'checkbox')
{
var hiddenformname='java'+name;
var chkname='answer'+name;
if (document.getElementById(chkname).checked)
{
document.getElementById(hiddenformname).value='Y';
} else
{
document.getElementById(hiddenformname).value='';
}
}

document.getElementById('runonce').value=1;
}
//-->
</script>


<!-- START THE GROUP -->
</td>
</tr>
<tr>
<td class="separator"></td>
</tr>
<tr>
<td>

<div class="groupName">groep2.3</div>




<!-- PRESENT THE QUESTIONS -->
<div id="question375" class="multiple-opt">
<table class="questionTable">
<tr>
<td>
<table width="100%" cellspacing="0">

<tr class="questionText">
<td>
<span class="questionCode">v5a:</span> <span class="asterisk"></span>[HIDDEN multiple options] 5. Stel u heeft € 100 te besteden, hoe zou u die verdelen over deze goede doelen? De som dient op €100 uit te komen. Als u aan een aandachtsgebied niets wilt geven vul dan een 0 in.<br /><br />
<span class="questionhelp">Selecteer de toepasselijke opties</span>


</td>
</tr>
<tr class="questionAnswer">

<td>
<input type="hidden" name="MULTI68179X12X375" value="26" />


<ul>


<li id='javatbd68179X12X3751'>
<input type='hidden' name='tbdisp68179X12X3751' id='tbdisp68179X12X3751' value='on' />

<input class="checkbox" type="checkbox" name="68179X12X3751" id="answer68179X12X3751" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3751" class="answertext">Nederlandse Hartstichting</label>
<input type="hidden" name="java68179X12X3751" id="java68179X12X3751" value="" />

</li>


<li id='javatbd68179X12X3752'>
<input type='hidden' name='tbdisp68179X12X3752' id='tbdisp68179X12X3752' value='on' />

<input class="checkbox" type="checkbox" name="68179X12X3752" id="answer68179X12X3752" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3752" class="answertext">Astma Fonds</label>
<input type="hidden" name="java68179X12X3752" id="java68179X12X3752" value="" />
</li>


<li id='javatbd68179X12X3753'>

<input type='hidden' name='tbdisp68179X12X3753' id='tbdisp68179X12X3753' value='on' />

<input class="checkbox" type="checkbox" name="68179X12X3753" id="answer68179X12X3753" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3753" class="answertext">Cliniclowns</label>
<input type="hidden" name="java68179X12X3753" id="java68179X12X3753" value="" />
</li>


<li id='javatbd68179X12X3754' style='display: none'>

<input type='hidden' name='tbdisp68179X12X3754' id='tbdisp68179X12X3754' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X3754" id="answer68179X12X3754" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3754" class="answertext">Diabetes Fonds</label>
<input type="hidden" name="java68179X12X3754" id="java68179X12X3754" value="" />
</li>


<li id='javatbd68179X12X3755' style='display: none'>

<input type='hidden' name='tbdisp68179X12X3755' id='tbdisp68179X12X3755' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X3755" id="answer68179X12X3755" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3755" class="answertext">Hersenstichting Nederland</label>

<input type="hidden" name="java68179X12X3755" id="java68179X12X3755" value="" />
</li>


<li id='javatbd68179X12X3756' style='display: none'>

<input type='hidden' name='tbdisp68179X12X3756' id='tbdisp68179X12X3756' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X3756" id="answer68179X12X3756" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3756" class="answertext">Jantje Beton</label>
<input type="hidden" name="java68179X12X3756" id="java68179X12X3756" value="" />
</li>



<li id='javatbd68179X12X3757' style='display: none'>

<input type='hidden' name='tbdisp68179X12X3757' id='tbdisp68179X12X3757' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X3757" id="answer68179X12X3757" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3757" class="answertext">Jump (Kinderhartenfonds)</label>
<input type="hidden" name="java68179X12X3757" id="java68179X12X3757" value="" />
</li>


<li id='javatbd68179X12X3758' style='display: none'>

<input type='hidden' name='tbdisp68179X12X3758' id='tbdisp68179X12X3758' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X3758" id="answer68179X12X3758" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3758" class="answertext">Kika (Kinderen Kanker Vrij)</label>
<input type="hidden" name="java68179X12X3758" id="java68179X12X3758" value="" />
</li>


<li id='javatbd68179X12X3759' style='display: none'>

<input type='hidden' name='tbdisp68179X12X3759' id='tbdisp68179X12X3759' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X3759" id="answer68179X12X3759" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X3759" class="answertext">KWF Kankerbestrijding</label>
<input type="hidden" name="java68179X12X3759" id="java68179X12X3759" value="" />
</li>


<li id='javatbd68179X12X37510' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37510' id='tbdisp68179X12X37510' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37510" id="answer68179X12X37510" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37510" class="answertext">Natuurmonumenten</label>

<input type="hidden" name="java68179X12X37510" id="java68179X12X37510" value="" />
</li>


<li id='javatbd68179X12X37511' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37511' id='tbdisp68179X12X37511' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37511" id="answer68179X12X37511" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37511" class="answertext">Nederland War Child</label>
<input type="hidden" name="java68179X12X37511" id="java68179X12X37511" value="" />
</li>



<li id='javatbd68179X12X37512' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37512' id='tbdisp68179X12X37512' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37512" id="answer68179X12X37512" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37512" class="answertext">Nederlandse Cystic Fibrosis Stichting</label>
<input type="hidden" name="java68179X12X37512" id="java68179X12X37512" value="" />
</li>


<li id='javatbd68179X12X37513' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37513' id='tbdisp68179X12X37513' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37513" id="answer68179X12X37513" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37513" class="answertext">Nederlandse Rode Kruis</label>
<input type="hidden" name="java68179X12X37513" id="java68179X12X37513" value="" />
</li>


<li id='javatbd68179X12X37514' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37514' id='tbdisp68179X12X37514' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37514" id="answer68179X12X37514" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37514" class="answertext">Nelson Mandela Kinderfonds</label>
<input type="hidden" name="java68179X12X37514" id="java68179X12X37514" value="" />
</li>


<li id='javatbd68179X12X37515' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37515' id='tbdisp68179X12X37515' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37515" id="answer68179X12X37515" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37515" class="answertext">Nierstichting Nederland</label>

<input type="hidden" name="java68179X12X37515" id="java68179X12X37515" value="" />
</li>


<li id='javatbd68179X12X37516' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37516' id='tbdisp68179X12X37516' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37516" id="answer68179X12X37516" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37516" class="answertext">Novib</label>
<input type="hidden" name="java68179X12X37516" id="java68179X12X37516" value="" />
</li>



<li id='javatbd68179X12X37517' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37517' id='tbdisp68179X12X37517' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37517" id="answer68179X12X37517" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37517" class="answertext">Reumafonds</label>
<input type="hidden" name="java68179X12X37517" id="java68179X12X37517" value="" />
</li>


<li id='javatbd68179X12X37518' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37518' id='tbdisp68179X12X37518' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37518" id="answer68179X12X37518" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37518" class="answertext">Ronald McDonald fonds</label>
<input type="hidden" name="java68179X12X37518" id="java68179X12X37518" value="" />
</li>


<li id='javatbd68179X12X37519' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37519' id='tbdisp68179X12X37519' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37519" id="answer68179X12X37519" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37519" class="answertext">SOS Kinderdorpen</label>
<input type="hidden" name="java68179X12X37519" id="java68179X12X37519" value="" />
</li>


<li id='javatbd68179X12X37520' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37520' id='tbdisp68179X12X37520' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37520" id="answer68179X12X37520" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37520" class="answertext">Unicef</label>

<input type="hidden" name="java68179X12X37520" id="java68179X12X37520" value="" />
</li>


<li id='javatbd68179X12X37521' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37521' id='tbdisp68179X12X37521' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37521" id="answer68179X12X37521" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37521" class="answertext">Wereld Natuur Fonds</label>
<input type="hidden" name="java68179X12X37521" id="java68179X12X37521" value="" />
</li>



<li id='javatbd68179X12X37522' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37522' id='tbdisp68179X12X37522' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37522" id="answer68179X12X37522" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37522" class="answertext">Zonnebloem</label>
<input type="hidden" name="java68179X12X37522" id="java68179X12X37522" value="" />
</li>


<li id='javatbd68179X12X37523' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37523' id='tbdisp68179X12X37523' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37523" id="answer68179X12X37523" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37523" class="answertext">Een ander goed doel op het gebied van natuur en milieu</label>
<input type="hidden" name="java68179X12X37523" id="java68179X12X37523" value="" />
</li>


<li id='javatbd68179X12X37524' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37524' id='tbdisp68179X12X37524' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37524" id="answer68179X12X37524" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37524" class="answertext">Een ander goed doel op het gebied van gezondheid</label>
<input type="hidden" name="java68179X12X37524" id="java68179X12X37524" value="" />
</li>


<li id='javatbd68179X12X37525' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37525' id='tbdisp68179X12X37525' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37525" id="answer68179X12X37525" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37525" class="answertext">Een ander goed doel op het gebied van welzijn en cultuur</label>

<input type="hidden" name="java68179X12X37525" id="java68179X12X37525" value="" />
</li>


<li id='javatbd68179X12X37526' style='display: none'>

<input type='hidden' name='tbdisp68179X12X37526' id='tbdisp68179X12X37526' value='off' />

<input class="checkbox" type="checkbox" name="68179X12X37526" id="answer68179X12X37526" value="Y" onclick='cancelBubbleThis(event);noop_checkconditions(this.value, this.name, this.type)' />
<label for="answer68179X12X37526" class="answertext">Een ander goed doel op het gebied van internationale hulp</label>
<input type="hidden" name="java68179X12X37526" id="java68179X12X37526" value="" />
</li>

</ul>

<input type='hidden' name='display68179X12X375' id='display375' value='on' />

</td>
</tr>
<tr>
<td>
<span class="survey-question-help"></span>
</td>

</tr>
</table>
</td>
</tr>
</table>
</div>
<div id="question402" class="numeric-multi">
<table class="questionTable">
<tr>

<td>
<table width="100%" cellspacing="0">
<tr class="questionText">
<td>
<span class="questionCode">v5b:</span> <span class="asterisk"></span>5. Stel u heeft € 100 te besteden, hoe zou u die verdelen over deze goede doelen? De som dient op €100 uit te komen. Als u aan een aandachtsgebied niets wilt geven vul dan een 0 in.<br />
<script type="text/javascript" charset="utf-8">

$(document).ready(function() {

handleChecked3(375, 402);

function handleChecked3(q1ID, q2ID) {

// Hide Q1
$('#question'+q1ID+'').hide();

// Loop through all hidden Q1 options
$('#question'+q1ID+' li[id^="javatbd"]:hidden').each(function(i) {

// Find the answer value
var ansTxt = $('label', this).text();

// Find the corresponding list item in Q2
var el = $('#question'+q2ID+' label[for^="answer"]').filter(function(){return $(this).text() == ansTxt;}).parent('li:eq(0)');

// Hide the corresponding list item in Q2
$(el).hide();

// Set the corresponding input in Q2 to 0
$('input.text', el).val(0);

});

// Calculate for sum amount
calculateValue68179X12X402(3) // NOTE: this needs to use local survey, group and q2 question IDs
}
});

</script><br />
<span class="questionhelp"></span>



</td>
</tr>
<tr class="questionAnswer">
<td>
<p class="tip">In dit veld kunnen alleen cijfers worden ingevoerd</p>
<p id="equals_num_value_68179X12X402" class="tip">Het totaal moet gelijk zijn aan 100</p>
<ul>
<li>
<label for="answer68179X12X4021">Nederlandse Hartstichting</label>

<span class="input">

<input class="text" type="text" size="10" name="68179X12X4021" id="answer68179X12X4021" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X4022">Astma Fonds</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4022" id="answer68179X12X4022" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>

<li>
<label for="answer68179X12X4023">Cliniclowns</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4023" id="answer68179X12X4023" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X4024">Diabetes Fonds</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4024" id="answer68179X12X4024" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />


</span>
</li>
<li>
<label for="answer68179X12X4025">Hersenstichting Nederland</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4025" id="answer68179X12X4025" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>

<label for="answer68179X12X4026">Jantje Beton</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4026" id="answer68179X12X4026" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X4027">Jump (Kinderhartenfonds)</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4027" id="answer68179X12X4027" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />


</span>
</li>
<li>
<label for="answer68179X12X4028">Kika (Kinderen Kanker Vrij)</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X4028" id="answer68179X12X4028" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X4029">KWF Kankerbestrijding</label>

<span class="input">

<input class="text" type="text" size="10" name="68179X12X4029" id="answer68179X12X4029" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40210">Natuurmonumenten</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40210" id="answer68179X12X40210" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>

<li>
<label for="answer68179X12X40211">Nederland War Child</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40211" id="answer68179X12X40211" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40212">Nederlandse Cystic Fibrosis Stichting</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40212" id="answer68179X12X40212" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />


</span>
</li>
<li>
<label for="answer68179X12X40213">Nederlandse Rode Kruis</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40213" id="answer68179X12X40213" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>

<label for="answer68179X12X40214">Nelson Mandela Kinderfonds</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40214" id="answer68179X12X40214" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40215">Nierstichting Nederland</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40215" id="answer68179X12X40215" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />


</span>
</li>
<li>
<label for="answer68179X12X40216">Novib</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40216" id="answer68179X12X40216" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40217">Reumafonds</label>

<span class="input">

<input class="text" type="text" size="10" name="68179X12X40217" id="answer68179X12X40217" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40218">Ronald McDonald fonds</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40218" id="answer68179X12X40218" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>

<li>
<label for="answer68179X12X40219">SOS Kinderdorpen</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40219" id="answer68179X12X40219" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40220">Unicef</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40220" id="answer68179X12X40220" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />


</span>
</li>
<li>
<label for="answer68179X12X40221">Wereld Natuur Fonds</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40221" id="answer68179X12X40221" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>

<label for="answer68179X12X40222">Zonnebloem</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40222" id="answer68179X12X40222" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40223">Een ander goed doel op het gebied van natuur en milieu</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40223" id="answer68179X12X40223" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />


</span>
</li>
<li>
<label for="answer68179X12X40224">Een ander goed doel op het gebied van gezondheid</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40224" id="answer68179X12X40224" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40225">Een ander goed doel op het gebied van welzijn en cultuur</label>

<span class="input">

<input class="text" type="text" size="10" name="68179X12X40225" id="answer68179X12X40225" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>
<li>
<label for="answer68179X12X40226">Een ander goed doel op het gebied van internationale hulp</label>
<span class="input">

<input class="text" type="text" size="10" name="68179X12X40226" id="answer68179X12X40226" value="" onkeyup="noop_checkconditions(this.value, this.name, this.type);" onkeypress="inputField = event.srcElement ? event.srcElement : event.target || event.currentTarget; if (inputField.value.indexOf('.')>0 && String.fromCharCode(getkey(event))=='.') return false; return goodchars(event,'0123456789.')" onblur="calculateValue68179X12X402(3)" maxlength="25" />

</span>
</li>

<li class='multiplenumerichelp'>
<label for="remainingvalue_68179X12X402">
Nog te gaan:
</label>
<span>

<input size=10 type='text' id="remainingvalue_68179X12X402" disabled="disabled" />

</span>
</li>
<li class='multiplenumerichelp'>
<label for="totalvalue_68179X12X402">
Totaal:

</label>
<span>

<input size=10 type="text" id="totalvalue_68179X12X402" disabled="disabled" />

</span>
</li>
</ul>
<input type="hidden" name="qattribute_answer[]" value="68179X12X402" />
<input type="hidden" name="qattribute_answer68179X12X402" />
<script type='text/javascript'>
function calculateValue68179X12X402(method) {
if(document.limesurvey.answer68179X12X4021.value == '') { document.limesurvey.answer68179X12X4021.value = 0; }
if(document.limesurvey.answer68179X12X4022.value == '') { document.limesurvey.answer68179X12X4022.value = 0; }
if(document.limesurvey.answer68179X12X4023.value == '') { document.limesurvey.answer68179X12X4023.value = 0; }
if(document.limesurvey.answer68179X12X4024.value == '') { document.limesurvey.answer68179X12X4024.value = 0; }
if(document.limesurvey.answer68179X12X4025.value == '') { document.limesurvey.answer68179X12X4025.value = 0; }
if(document.limesurvey.answer68179X12X4026.value == '') { document.limesurvey.answer68179X12X4026.value = 0; }
if(document.limesurvey.answer68179X12X4027.value == '') { document.limesurvey.answer68179X12X4027.value = 0; }
if(document.limesurvey.answer68179X12X4028.value == '') { document.limesurvey.answer68179X12X4028.value = 0; }
if(document.limesurvey.answer68179X12X4029.value == '') { document.limesurvey.answer68179X12X4029.value = 0; }
if(document.limesurvey.answer68179X12X40210.value == '') { document.limesurvey.answer68179X12X40210.value = 0; }
if(document.limesurvey.answer68179X12X40211.value == '') { document.limesurvey.answer68179X12X40211.value = 0; }
if(document.limesurvey.answer68179X12X40212.value == '') { document.limesurvey.answer68179X12X40212.value = 0; }
if(document.limesurvey.answer68179X12X40213.value == '') { document.limesurvey.answer68179X12X40213.value = 0; }
if(document.limesurvey.answer68179X12X40214.value == '') { document.limesurvey.answer68179X12X40214.value = 0; }
if(document.limesurvey.answer68179X12X40215.value == '') { document.limesurvey.answer68179X12X40215.value = 0; }
if(document.limesurvey.answer68179X12X40216.value == '') { document.limesurvey.answer68179X12X40216.value = 0; }
if(document.limesurvey.answer68179X12X40217.value == '') { document.limesurvey.answer68179X12X40217.value = 0; }
if(document.limesurvey.answer68179X12X40218.value == '') { document.limesurvey.answer68179X12X40218.value = 0; }
if(document.limesurvey.answer68179X12X40219.value == '') { document.limesurvey.answer68179X12X40219.value = 0; }
if(document.limesurvey.answer68179X12X40220.value == '') { document.limesurvey.answer68179X12X40220.value = 0; }
if(document.limesurvey.answer68179X12X40221.value == '') { document.limesurvey.answer68179X12X40221.value = 0; }
if(document.limesurvey.answer68179X12X40222.value == '') { document.limesurvey.answer68179X12X40222.value = 0; }
if(document.limesurvey.answer68179X12X40223.value == '') { document.limesurvey.answer68179X12X40223.value = 0; }
if(document.limesurvey.answer68179X12X40224.value == '') { document.limesurvey.answer68179X12X40224.value = 0; }
if(document.limesurvey.answer68179X12X40225.value == '') { document.limesurvey.answer68179X12X40225.value = 0; }
if(document.limesurvey.answer68179X12X40226.value == '') { document.limesurvey.answer68179X12X40226.value = 0; }
bob = eval('document.limesurvey.qattribute_answer68179X12X402');
totalvalue_68179X12X402=(parseInt(parseFloat(document.limesurvey.answer68179X12X4021.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4022.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4023.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4024.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4025.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4026.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4027.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4028.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X4029.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40210.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40211.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40212.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40213.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40214.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40215.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40216.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40217.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40218.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40219.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40220.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40221.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40222.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40223.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40224.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40225.value)*1000) + parseInt(parseFloat(document.limesurvey.answer68179X12X40226.value)*1000))/1000;
$('#totalvalue_68179X12X402').val(parseFloat(totalvalue_68179X12X402));
var ua = navigator.appVersion.indexOf('MSIE');
var ieAtt = ua != -1 ? 'className' : 'class';
switch(method)
{
case 1:
if (totalvalue_68179X12X402 > 0)
{
bob.value = 'Het antwoord is ongeldig. Het totaal zou minder moeten zijn dan 0';
document.getElementById('totalvalue_68179X12X402').setAttribute(ieAtt,'tip problem');
document.getElementById('max_num_value_68179X12X402').setAttribute(ieAtt,'tip problem');
}
else
{
if (bob.value == '' || bob.value == 'Het antwoord is ongeldig. Het totaal zou minder moeten zijn dan 0')
{
bob.value = '';
document.getElementById('totalvalue_68179X12X402').setAttribute(ieAtt,'tip good');
}
document.getElementById('max_num_value_68179X12X402').setAttribute(ieAtt,'tip good');
}
break;
case 2:
if (totalvalue_68179X12X402 < 0)
{
bob.value = 'Antwoord is ongeldig. Het totaal van alle invoerwaarden moet opgeteld minstens 0 zijn.';
document.getElementById('totalvalue_68179X12X402').setAttribute(ieAtt,'tip problem');
document.getElementById('min_num_value_68179X12X402').setAttribute(ieAtt,'tip problem');
}
else
{
if (bob.value == '' || bob.value == 'Antwoord is ongeldig. Het totaal van alle invoerwaarden moet opgeteld minstens 0 zijn.')
{
bob.value = '';
document.getElementById('totalvalue_68179X12X402').setAttribute(ieAtt,'tip good');
}
document.getElementById('min_num_value_68179X12X402').setAttribute(ieAtt,'tip good');
}
break;
case 3:
remainingvalue = (parseInt(parseFloat(100)*1000) - parseInt(parseFloat(totalvalue_68179X12X402)*1000))/1000;
document.getElementById('remainingvalue_68179X12X402').value=remainingvalue;
if (totalvalue_68179X12X402 == 100)
{
if (bob.value == '' || bob.value == 'Het antwoord is ongeldig. Het totaal zou minder moeten zijn dan 100')
{
bob.value = '';
document.getElementById('totalvalue_68179X12X402').setAttribute(ieAtt,'tip good');
document.getElementById('equals_num_value_68179X12X402').setAttribute(ieAtt,'tip good');
}
}
else
{
bob.value = 'Het antwoord is ongeldig. Het totaal zou minder moeten zijn dan 100';
document.getElementById('totalvalue_68179X12X402').setAttribute(ieAtt,'tip problem');
document.getElementById('equals_num_value_68179X12X402').setAttribute(ieAtt,'tip problem');
}
break;
}
}
calculateValue68179X12X402(3);
</script>

<input type='hidden' name='display68179X12X402' id='display402' value='on' />

</td>
</tr>
<tr>
<td>
<span class="survey-question-help"></span>
</td>
</tr>
</table>
</td>

</tr>
</table>
</div>


<!-- END THE GROUP -->
</td>
</tr>



<!-- PRESENT THE NAVIGATOR -->

<tr>
<td>
<table class="navigatorTable">
<tr>
<td align="center">
<span class="submit-buttons"><input type="hidden" name="move" value="movenext" id="movenext" /><input class='submit' accesskey='p' type='button' onclick="javascript:document.limesurvey.move.value = 'moveprev'; $('#limesurvey').submit();" value=' << Vorige ' name='move2' id='moveprevbtn' />
<input class='submit' type='submit' accesskey='n' onclick="javascript:document.limesurvey.move.value = 'movenext';" value=' Volgende >> ' name='move2' id='movenextbtn' />
</span><br />
<span class="clear-all"><input type='button' name='clearallbtn' value='Afbreken en antwoorden verwijderen' class='clearall' onclick="if (confirm('Wilt u al uw antwoorden verwijderen?')) {window.open('survey.wwavdata.nl/limesurvey/index.php?...clearall&lang=nl', '_top')}" /></span>

<span class="save-all"><input type='button' name='saveallbtn' value='Hervat later' class='saveall' onclick="javascript:document.limesurvey.move.value = this.value;addHiddenField(document.getElementById('limesurvey'),'saveall',this.value);document.getElementById('limesurvey').submit();" disabled='disabled'/></span>
</td>
</tr>
</table>
</td>
</tr>
</table>

<center><font color='red' size='2'>Deze vragenlijst is nu niet actief. Uw antwoorden kunnen niet worden bewaard.</font></center>
<!-- group2.php -->

<input type='hidden' name='thisstep' value='5' id='thisstep' />
<input type='hidden' name='sid' value='68179' id='sid' />
<input type='hidden' name='token' value='' id='token' />
</form>
</div>



</body>
</html>
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 3 years 4 months ago #59875

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4130
  • Thank you received: 763
  • Karma: 347
Jan, do you get any JavaScript errors? Can you re-activate the survey for me?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 3 years 4 months ago #59876

The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 3 years 4 months ago #59877

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4130
  • Thank you received: 763
  • Karma: 347
Oops, my mistake - use this:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		handleChecked3(MM, NN);
 
		function handleChecked3(q1ID, q2ID) {
 
			// Loop through all hidden Q1 options
			$('#question'+q1ID+' li[id^="javatbd"]:hidden').each(function(i) {
 
				// Find the answer value
				var ansTxt = $('label', this).text();
 
				// Find the corresponding list item in Q2
				var el = $('#question'+q2ID+' label[for^="answer"]').filter(function(){return $(this).text() == ansTxt;}).parent('li:eq(0)');
 
				// Hide the corresponding list item in Q2
				$(el).hide();
 
				// Set the corresponding input in Q2 to 0
				$('input.text', el).val(0);
 
			});
 
			// Hide Q1
			$('#question'+q1ID+'').hide();
 
			// Calculate for sum amount
			calculateValue68179X12X402(3) // NOTE: this needs to use local survey, group and q2 question IDs
		}
	});
 
</script>
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 3 years 4 months ago #59899

Tony,

It's working. Many thanks for the excellent support. Now I will convince mu client to choose LS!

Jan Willem
Last Edit: 3 years 4 months ago by janwillem64. Reason: forgot some words
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 2 years 11 months ago #65915

  • stigchelg
  • stigchelg's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Hey all,

I've been tinkering with this workaround for a couple of days but I can't get it to work. I'm not very good with java script at all. I can pretty much cut and paste and hope for the best so bare with me here. But I've applied the workaround as described and it's not working. So clearly i'm doing something wrong.

I have 3 multiple option questions filtered into one collection questions which will be hidden. Each on it's own page. The collection question has all the answers given in the previous 3 auto checked.

I set up a new page with one multiops question that has the collections question as it's array filter(id227) and one ranking question(id209). This is the one that doesn't work. I've made sure the collection question, the multiops and the ranking question have the same 17 answers. The ranking questions isn't filtering however, it's just showing those 17 answers.

You mentioned that the code has to be entered into the template file, but I'm using LimeService so I have no control over the files. I added the code to the questions themselves. This seems to work just fine with other java script (such as the script I used to compile the 3 multiple options into one).
I entered the short code into the multiops question and the long code into the ranking question. Is that correct? I used the array filtered multiops as the 'MM' question and entered 227 as it's id into the script. I added the ranking questions id 209 as the 'RR'into the script. The multiops questions with the short script is not hidden (but will be)and is ahead of the ranking question with the long script.

So, in short. The ranking question is not hiding when no option is selected, because somehow it sees all 17 options as selected. How come?

edit1: The big script doesn't seem to be working at all. It makes no difference with or without it added to either the group, the multiops or the ranking question.

edit2:do I need to change (q1ID, q2ID)and all other mentions of these with my question ID's? In other words does the big script need to be adapted too?
Last Edit: 2 years 11 months ago by stigchelg.
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 2 years 11 months ago #65923

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4130
  • Thank you received: 763
  • Karma: 347
do I need to change (q1ID, q2ID)and all other mentions of these with my question ID's?
No, they will return what you have for MM and RR in rankFilter(MM, RR, 1);.
I entered the short code into the multiops question and the long code into the ranking question. Is that correct?
You can place all of the code in one of the questions. Are there any JavaScript errors? Can you paste all of the code you are using?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 2 years 11 months ago by tpartner.
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 2 years 11 months ago #65926

  • stigchelg
  • stigchelg's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
Rightio. First off, I managed to get a little less stupid by stumbling into the template.js file. I added the long script, unaltered to the end of it. Just pasted it in.
/*
* LimeSurvey
* Copyright (C) 2007 The LimeSurvey Project Team / Carsten Schmitz
* All rights reserved.
* License: GNU/GPL License v2 or later, see LICENSE.php
* LimeSurvey is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
*
* Description:JavaScript file for templates. Put JS-functions for your template here.
*
*
* $Id:$
*/


/*
* The function focusFirst puts the Focus on the first non-hidden element in the Survey.
*
* Normally this is the first input field (the first answer).
*/
function focusFirst(Event)
{
$('#limesurvey :input:visible:enabled:first').focus();
}
/*
* The focusFirst function is added to the eventlistener, when the page is loaded.
*
* This can be used to start other functions on pageload as well. Just put it inside the 'ready' function block
*/

/* Uncomment below if you want to use the focusFirst function */
/*
$(document).ready(function(){
focusFirst();
});
*/

$(document).ready(function(){
// If the question code and number are hidden, hide any white space in the span(for dumb browsers)
if($('.qnumcode').text().replace(/\s/g, '').length == 0) {
$('.qnumcode').hide();
}
});

// A function to filter choices in a ranking question
function rankFilter(q1ID, q2ID, prevPage) {

// If filter question is on a previous page, hide Q1 and check all "visible" boxes
if(prevPage == 1) {
$('#question'+q1ID+' li[id^="javatbd"]:visible input.checkbox').attr('checked', true);
$('#question'+q1ID+'').hide();
}

handleChecked(q1ID, q2ID);

$('#question'+q1ID+' input.checkbox').click(function() {
handleChecked(q1ID, q2ID);
});

function handleChecked(q1ID, q2ID) {

// Find the survey and group IDs
if($( 'input#fieldnames' ).length != 0) {
var fieldNames = $( 'input#fieldnames' ).attr('value');
var tmp = fieldNames.split('X');
var sID = tmp[0];
var gID = tmp[1];
}

// Loop through all Q1 options
$('#question'+q1ID+' input.checkbox').each(function(i) {

// Find the answer code and value
var tmp2 = $(this).attr('id').split('X'+gID+'X'+q1ID+'');
var ansCode = tmp2[1];
var ansTxt = $(this).next('label').text();

// If option is checked and not in rank choices or output, add it to the rank choices
if($(this).attr('checked') == true
&& $('#question'+q2ID+' select.select option[value="'+ansCode+'"]').length == 0
&& $('#question'+q2ID+' .output input[id^="fvalue_"][value="'+ansCode+'"]').length == 0) {
$('<option value="'+ansCode+'">'+ansTxt+'</option>').appendTo('#question'+q2ID+' select.select');
}
// If option is unchecked...
else if($(this).attr('checked') == false) {
// Remove it from the rank choices
$('#question'+q2ID+' select.select option[value="'+ansCode+'"]').remove();
// Remove it from the rank output and reset hidden values
$('#question'+q2ID+' .output input[id^="fvalue_"][value="'+ansCode+'"]').attr('value', '').siblings('input.text').val('').siblings('img').hide();
}
});

// Clean up empty inputs in the rank output table
$('#question'+q2ID+' .output table tr').each(function(i) {
var nextRow = $(this).next('tr');
if($('input.text', this).val() == '' && $('input.text', nextRow).val() != '') {
$('input.text', this).val($('input.text', nextRow).val());
$('input.text', nextRow).val('');
$('input[id^="fvalue_"]', this).attr('value', $('input[id^="fvalue_"]', nextRow).attr('value'));
$('input[id^="fvalue_"]', nextRow).attr('value', '');
}
});

// Show the scissors for the last populated rank output row
$('#question'+q2ID+' .output table img[id^="cut_"]').hide();
$('#question'+q2ID+' .output table input.text[value!=""]:last').siblings('img[id^="cut_"]').show();

// Hide extra rank output rows
var optNum = $('#question'+q1ID+' input.checkbox:checked').length;
$('#question'+q2ID+' .output table tr').hide();
$('#question'+q2ID+' .output table tr:lt('+(optNum+1)+')').show();

// Hide and clear the ranking question if there are less than 2 checked options in Q1
if(optNum < 2) {
$('#question'+q2ID+'').hide();
$('#question'+q2ID+' input.text').val('');
$('#question'+q2ID+' input[id^="fvalue_"]').attr('value', '');
}
else {
$('#question'+q2ID+'').show();
}

// A work around for the built in max-answers function
$('#question'+q2ID+' select.select').attr('disabled', true);
$('#question'+q2ID+' td.output tr:visible').each(function(i) {
if($('input.text', this).val() == '') {
$('#question'+q2ID+' select.select').attr('disabled', false);
}
});
}

// A listener to work around the built in max-answers function
$('#question'+q2ID+' td.rank').click(function (event) {
$('#question'+q2ID+' select.select').attr('disabled', true);
$('#question'+q2ID+' td.item input.text').each(function(i) {
if ($(this).val() == '') {
$('#question'+q2ID+' select.select').attr('disabled', false);
}
});
});
}
Ok, the ranking question has this script:
this is the ranking array filtered from the multiops on the same page <script type="text/javascript" charset="utf-8">

$(document).ready(function() {

rankFilter(245, 264);
});
</script>
where 245 is the multiops ID and 264 is the ranking questions ID.

THe multiops has no code.

Both have the same 17 answers.
The administrator has disabled public write access.

Re: fill ranking array with answers from previous question 2 years 11 months ago #65930

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4130
  • Thank you received: 763
  • Karma: 347
That all looks fine.

Are you firing the script that auto-checks the multi-options before firing rankFilter()?

Are there any JavaScript errors?

Can you activate a sample survey for us to see?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.430 seconds
Donation Image