Welcome to the LimeSurvey Community Forum

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

Array - multiple buttons within a cell

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 week ago #233366 by Joffm
Replied by Joffm on topic Array - multiple buttons within a cell

only be allowed to select 1 answer per box, so they would be allowed to make 6 choices max

These are radio buttons, so how can you select more than one in each box?

But unfortunately there were some typos regarding name="radio_".
There are some entries with name="radio".
So check and add the underscore and everything is fine.

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

Please Log in to join the conversation.

  • boshra.m
  • boshra.m's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 1 week ago #233367 by boshra.m
Replied by boshra.m on topic Array - multiple buttons within a cell
Ah okay I will try that. Well, I don't want them to but as it is right now, they can.

 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 week ago #233371 by Joffm
Replied by Joffm on topic Array - multiple buttons within a cell
Yes, exactly
Here you see
Code:
        <span onclick="checkClosest(this)"> <input value="5"   class="inserted-radio" type="radio" name="radio_" id="radio-5" /> 3 hours</span><br />\
        <span onclick="checkClosest(this)"> <input value="6"   class="inserted-radio" type="radio" name="radio"   id="radio-6" /> 4 hours</span><br />\
        <span onclick="checkClosest(this)"> <input value="7"   class="inserted-radio" type="radio" name="radio"   id="radio-7" /> 5 hours</span><br />\
        <span onclick="checkClosest(this)"> <input value="8"   class="inserted-radio" type="radio" name="radio"   id="radio-8" /> 6 hours</span><br />\
        <span onclick="checkClosest(this)"> <input value="9"   class="inserted-radio" type="radio" name="radio"   id="radio-9" /> 7 hours</span><br />\
        <span onclick="checkClosest(this)"> <input value="10" class="inserted-radio" type="radio" name="radio"   id="radio-10" /> 8 hours</span><br />\
        <span onclick="checkClosest(this)"> <input value="12" class="inserted-radio" type="radio" name="radio_" id="radio-12" /> More than 8 hours</span><br />\

Up to value "5" it is fine, followed by names without underscores, and "12" again with.

So these radio-Buttons belong to different groups and behave independently.

Joffm

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

Please Log in to join the conversation.

  • boshra.m
  • boshra.m's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 years 1 week ago #233470 by boshra.m
Replied by boshra.m on topic Array - multiple buttons within a cell
Hello,

Okay so I was able to make it work visually and I am SO close but the only thing that isn't working is when I move onto the next page of the survey, the responses I entered disappear. This also happens when I go back and use the previous button or even when I decide to answer the question. I have attached the survey to better explain what I mean. 

Thank you all. 

 

File Attachment:

File Name: limesurvey...6157.lss
File Size:72 KB

 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 1 week ago #233471 by Joffm
Replied by Joffm on topic Array - multiple buttons within a cell
Hi,
I do not see that anything disappears, when you proceed to the next page.
Data is saved in the answer table.
Everything is fine.
 



And that the radios are empty again when a respondent goes BACK to this question, well, who allows people to go back?

Okay, as said before, this is an old (an a bit unusual) script and it seems that the original thread isn't there anymore.
So you can't ask the author (as far as I remember he was Polish).
I can't help. Either you adapt it by yourself, wait for somebody here, or revise the layout.
You see, I am still wondering why you do not use built-in features like an array by column with some css ("no-question", "no-bottom") and inserted subheaders
 

Or something quite different (Sliders with or without tick marks)

And your second question (s324):
Something like GIGO (Garbage in - Garbage out).
It is obvious that you do not see anything, if there is no subquestion.
If you want to get a subquestion, but without header, you have to enter at least a blank.


Joffm

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

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 6 days ago #233478 by Joffm
Replied by Joffm on topic Array - multiple buttons within a cell
And here a different approach.
It's an adaptation of the "old" 'green apple - banana' example
and more recently this
[url] forums.limesurvey.org/forum/can-i-do-thi...ckbox-into-the-table [/url]
and
[url] forums.limesurvey.org/forum/design-issue...ased-previous-answer [/url]

Both show how to insert radio buttons into a HTMl table.

May look like this




Without any fine tuning in styling.

And going back the values are still there
You use a simple array. and move the buttons, whereas the other script creates new buttons.

Joffm

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

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose