Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Hide answer option - Calculate value is not defined

Hide answer option - Calculate value is not defined 3 Jahre 7 Stunden her #64098

  • asonimie
  • asonimies Avatar
I have an active survey with some data on it already. I want to hide two answer options in an array quesiton. I keep on getting an error of calculatevalueSIDXGIDXQID is not defined. Not sure what's causing that error.

Here's an example of the survey

fpitesters.limeask.com/index.php?sid=69548&newtest=Y&lang=en

I'm using the following code:

<script type="text/javascript" charset="utf-8">

$(document).ready(function() {

hideRows(42739);

function hideRows(q1ID) {

// Loop through all Q1 sub-questions
$('#question'+q1ID+' li').each(function(i) {

if($('label', this).text() == 'No answer') {
$(this).hide();
$('input.text', this).val(0);
}

});

calculateValue69548X1356X42739(1); // NOTE: this needs to use local survey, group and q2 question IDs
}
});

</script>
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Re: Hide answer option - Calculate value is not defined 2 Jahre 11 Monate her #64103

  • tpartner
  • tpartners Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 4069
  • Dank erhalten: 748
  • Karma: 341
That script is for a different question type.

I assume you want to hide the "No answer" rows.

Try this:
<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function() {
 
		hideRows(42739);
 
		function hideRows(q1ID) {
 
			// Loop through all Q1 sub-questions
			$('#question'+q1ID+' table.question tbody').each(function(i) {
 
				if($('td.answertext', this).text() == 'No answer') {
					$(this).hide();
					$('input.radio', this).attr('checked', false);
				}
 
			});
		}
	});
 
</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.
Letzte Änderung: 2 Jahre 11 Monate her von tpartner.
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.389 Sekunden
Donation Image