Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Registration form with dynamic array with radio buttons.

  • BartMo
  • BartMo's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 3 weeks ago - 6 months 3 weeks ago #250809 by BartMo
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition   Versie 6.2.9+230925
Own server or LimeSurvey hosting: own server @ A2Hosting
Survey theme/template: Fruity TwentyThree
==================
Hi all
I'd like to make a registration form for workshops.
There are a lot of choices and limitations. I made a slide to explain what the requirements are.
I have seen a lot of topics that deal with parts of my question but I wonder if a survey like this already exists?
If not, what is the best way to achieve this?
 

 
Last edit: 6 months 3 weeks ago by BartMo.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 3 weeks ago #250815 by Joffm
Hi,
I#d recommend to swap the question.
"Sessions" as subquestions, Workshops as answer options
That's the easy way to display or not, or disable (depends on the array filter style) the two sessions if podcast is selected.
Reason: There is no subquestion relevance on answer options.

Now you have to validate that there is only one selection per row and per column.
Here you can use the function "is_unique()", like "is_unique(self)" as validation equation.

And at last the limitation of 25 per Workshop and session.
a. How to remove resp. disable single radio buttons.
Insert a script like this in the source code of the question
Code:
 <script type="text/javascript" charset="utf-8">
$(document).ready(function() {
    // Remove item 1 in in row 1
     $('#question{QID} tr[id^="javatbd"]:eq(0) .radio-item:eq(0) *').remove();
    // Disable item 4 in in row 3
     $('#question{QID} tr[id^="javatbd"]:eq(2) .radio-item:eq(3) *').prop('disabled',true);
});
</script>
With "eq(x) you define the row and the column, always starting with 0.

b. How to count the responses.
Read the manual about the included plugin "statFunctions"
With {statCountIf(Q3_Y001.sgqa,'3')} count the number of selections of code "3" in subquestion "Y001" of question Q3.

Change the script to something like this
Code:
$(document).ready(function() {
   var v11={statCountIf(Q3_Y001.sgqa,'1')};
   var v12={statCountIf(Q3_Y001.sgqa,'2')};
...
   var v21={statCountIf(Q3_Y002.sgqa,'1')};
...
 
  if (v11>25) {
       $('#question{QID} tr[id^="javatbd"]:eq(0) .radio-item:eq(0) *').remove();
  }
if (v12>25) {
       $('#question{QID} tr[id^="javatbd"]:eq(0) .radio-item:eq(1) *').remove();
  }
...
 
});
</script>
 
The first radio button is removed, the second disabled, and the third again removed.
As I wrote before, up to you what you prefer.

Now start to create a sample.
If there are further questions send a lss exort of these relevant questions.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose