Display number of rows in array question based on previous numerical input

More
1 year 11 months ago #121771 by Remundo
Remundo replied the topic: Display number of rows in array question based on previous numerical input
keyup is good :-)

Rémi Biscueil
Technicien en production et analyse de données
Service de l'évaluation, des études et du pilotage
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex

Please Log in to join the conversation.

More
1 year 10 months ago #122855 by jph123
jph123 replied the topic: Display number of rows in array question based on previous numerical input
Hi,

I too am having problems with this script on internet explorer 11. I've tried changing the file as suggested in the thread but this hasn't worked for me.
" If I add to template startpage.pstpl
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
then this script work on IE10 "
The beginning of my startpage.pstpl now reads:
<!--<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
<title>{SURVEYNAME} – {GROUPNAME}</title>
Is this correct or is there something else that needs to happen. (Script works fine in firefox and chrome)

Please Log in to join the conversation.

More
1 year 10 months ago #122856 by tpartner
tpartner replied the topic: Display number of rows in array question based on previous numerical input

I too am having problems with this script on internet explorer 11. I've tried changing the file as suggested in the thread but this hasn't worked for me.

What LimeSurvey version are you using? Did you try the latest attached .lss file with the default template?

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

Please Log in to join the conversation.

More
1 year 10 months ago #122859 by jph123
jph123 replied the topic: Display number of rows in array question based on previous numerical input
Version 2.05+ Build 150508 currently but can upgrade to the latest build if that will fix it. Not sure where / what the lss files are. I only see css and pstpl files in the template editor?

Please Log in to join the conversation.

More
1 year 10 months ago #122872 by jph123
jph123 replied the topic: Display number of rows in array question based on previous numerical input
Hi,

I've worked out why mine isn't working. I'm using a numerical input box for the number and this doesn't work on internet explorer for your lss file (test 3) if I change the input box from short text. Is there anything that can be done to tweak the script so this works or do I need to change the input fields to short text?

Please Log in to join the conversation.

More
1 year 10 months ago - 1 year 10 months ago #122880 by tpartner
tpartner replied the topic: Display number of rows in array question based on previous numerical input
Hmm...it seems that the built-in JS for enforcing numerics is conflicting in IE.

If you don't want to use short-text, how about a list (dropdown)?

<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
 
		// Identify the questions
		var q1ID = '{QID}';
		var q1 = $('#question'+q1ID+'');
		var q2 = $(q1).nextAll('.array-multi-flexi-text:eq(0)'); 
		var q2ID = $(q2).attr('id').split('question')[1];
 
		// Initial row handling
		handleRows($('.answer-item select', q1));
 
		// Listener on the numeric input
		$('.answer-item select', q1).change(function() {
			handleRows(this);
		});
 
		function handleRows(el) {
			var numRows = $(el).val();
			$('tr.subquestion-list', q2).hide();
			$('tr.subquestion-list', q2).each(function(i){
				if(i >= numRows) {
					$('input[type="text"], select', this).val('');
				}
				else {
					$(this).show();
				}
			})
		}
	});
</script>

File Attachment:

File Name: limesurvey...7(2).lss
File Size:22 KB

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last Edit: 1 year 10 months ago by tpartner.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now