Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

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

Display number of rows in array question based on previous numerical input 11 months 1 week ago #121771

  • Remundo
  • Remundo's Avatar
  • Offline
  • Platinum Lime
  • Posts: 543
  • Thank you received: 34
  • Karma: 11
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
The administrator has disabled public write access.

Display number of rows in array question based on previous numerical input 10 months 4 days ago #122855

  • jph123
  • jph123's Avatar
  • Offline
  • Premium Lime
  • Posts: 11
  • Karma: 0
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)
The administrator has disabled public write access.

Display number of rows in array question based on previous numerical input 10 months 4 days ago #122856

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5890
  • Thank you received: 1291
  • Karma: 520
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.
The administrator has disabled public write access.

Display number of rows in array question based on previous numerical input 10 months 4 days ago #122859

  • jph123
  • jph123's Avatar
  • Offline
  • Premium Lime
  • Posts: 11
  • Karma: 0
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?
The administrator has disabled public write access.

Display number of rows in array question based on previous numerical input 10 months 3 days ago #122872

  • jph123
  • jph123's Avatar
  • Offline
  • Premium Lime
  • Posts: 11
  • Karma: 0
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?
The administrator has disabled public write access.

Display number of rows in array question based on previous numerical input 10 months 3 days ago #122880

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5890
  • Thank you received: 1291
  • Karma: 520
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.
Last Edit: 10 months 3 days ago by tpartner.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.232 seconds