- Posts: 442
- Thank you received: 25
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Display number of rows in array question based on previous numerical input
- Remundo
- Offline
- Platinum Member
Less
More
8 years 10 months ago #121765
by Remundo
Rémi B.
Technicien en production, traitement, analyse de données et enquêtes
Observatoire de la réussite et de la vie étudiante (OREVE)
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex
Replied by Remundo on topic Display number of rows in array question based on previous numerical input
Hello,
Have you found a solution to this problem?
Have you found a solution to this problem?
ricardo wrote: Hi Tony,
There small glitch in this workaround
The rows don't display as soon as the number is entered...they only show up after clicking somewhere else...is there a way to make the rows appear as soon as the number is entered.
this is a link to the question broaderimpacts.org/surveys/limesurvey/index.php/289571/lang-en
rg
Rémi B.
Technicien en production, traitement, analyse de données et enquêtes
Observatoire de la réussite et de la vie étudiante (OREVE)
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
8 years 10 months ago #121769
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display number of rows in array question based on previous numerical input
@Remundo, an answer was given -
www.limesurvey.org/en/forum/can-i-do-thi...t?limitstart=0#95776
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Remundo
- Offline
- Platinum Member
Less
More
- Posts: 442
- Thank you received: 25
8 years 10 months ago #121770
by Remundo
Rémi B.
Technicien en production, traitement, analyse de données et enquêtes
Observatoire de la réussite et de la vie étudiante (OREVE)
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex
Replied by Remundo on topic Display number of rows in array question based on previous numerical input
I saw but it was only in relation to mouse movement and not if only changes the value at the keyboard!
Rémi B.
Technicien en production, traitement, analyse de données et enquêtes
Observatoire de la réussite et de la vie étudiante (OREVE)
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex
The topic has been locked.
- Remundo
- Offline
- Platinum Member
Less
More
- Posts: 442
- Thank you received: 25
8 years 10 months ago #121771
by Remundo
Rémi B.
Technicien en production, traitement, analyse de données et enquêtes
Observatoire de la réussite et de la vie étudiante (OREVE)
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex
Replied by Remundo on topic Display number of rows in array question based on previous numerical input
keyup is good
Rémi B.
Technicien en production, traitement, analyse de données et enquêtes
Observatoire de la réussite et de la vie étudiante (OREVE)
15, Rue de l'Hôtel Dieu 86022 POITIERS Cedex
The topic has been locked.
- jph123
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
8 years 9 months ago #122855
by jph123
Replied by jph123 on 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)
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 topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
8 years 9 months ago #122856
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display number of rows in array question based on previous numerical input
What LimeSurvey version are you using? Did you try the latest attached .lss file with the default template?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.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- jph123
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
8 years 9 months ago #122859
by jph123
Replied by jph123 on 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?
The topic has been locked.
- jph123
- Offline
- New Member
Less
More
- Posts: 8
- Thank you received: 0
8 years 9 months ago #122872
by jph123
Replied by jph123 on 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?
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 topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
8 years 9 months ago - 8 years 9 months ago #122880
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on 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)?
If you don't want to use short-text, how about a list (dropdown)?
Code:
<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>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
Last edit: 8 years 9 months ago by tpartner.
The topic has been locked.
- achecchini
- Offline
- Senior Member
Less
More
- Posts: 61
- Thank you received: 0
4 years 9 months ago #186086
by achecchini
Replied by achecchini on topic Display number of rows in array question based on previous numerical input
This is an oldies reply but always goodies!!
What if the question is a radio button, so if I chek the first radio button the rows in array must be three (3), on the second check six, (6) on thirth ten (10) ??
What if the question is a radio button, so if I chek the first radio button the rows in array must be three (3), on the second check six, (6) on thirth ten (10) ??
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
4 years 9 months ago #186091
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Display number of rows in array question based on previous numerical input
You don't need this script in recent versions of LimeSurvey - you have sub-question relevance to handle it for you.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.