Thanks in advance for any assistance. This board has been very helpful and responsive in the past.
- Custom question made up of 6 tables of radio button grids
- Each of the 6 tables has between 4 to 10 rows
- For some of the 6 tables, respondents will frequently want to select the same response (i.e. column) for all rows in the table
- Since the question is long, i’d like to make it as easy as possible for respondents to answer quickly)
- To achieve this, for 4 of the 6 tables, I’d like to offer a radio button above the column headings, that if clicked, will select that column for all rows in the grid question (to act as a short cut)
- I realise this isn’t good survey design but I’m trying to be a little pragmatic
You’ll see that there’s an extra checkbox at the top of each column, and you can click there to select/unselect an entire column. Is that what you’re looking for?
Here’s the script I used to accomplish this:
//Caitlin wrote this 01.12.16
$(‘.table1 tr:eq(0) th:eq(0)’).html(‘Select all in column’);
var col = $(this).attr(“title”);
$(“.table1 .sg-input-radio[title*=” + col + “]”).prop(“checked”,true);
$(“.table1 .sg-input-radio[title*=” + col + “]”).prop(“checked”,false);
You’ll only need to change a couple of things to make it work in your survey. I added the CSS hook table1 (under the Layout tab of the question) to the table I wanted to apply this to. Then, each of my column headers got a checkbox manually added to it. Where you would usually put your column title, I added in a bit of HTML, like this: <b>Not at all (1)</b><br />
<input title=”1″ type=”checkbox” />
We’re adding a checkbox with the title “1” there. I also added that to the rest of my column headers and just incremented the numbers to match the numbers in my column headers.
That should help get you started! If you want me to add a copy of that testing survey to your account so you can play around with it, just let me know.
hi again Caitlin. Would be great if you could include a copy of the testing survey to my account if that’s not too much trouble?
This is exactly what I want. I’ve managed to implement this effectively. thanks for your great response.