While we have a Ranking Grid question that automatically validates for a single answer per column there are some scenarios where you might wish to apply this type of validation to a Radio Button Grid question.
For example, in a Ranking Grid question the column headers are automatically created based on the number of rows (items to be ranked). So, if you have seven rows, the column headers will be automatically created as 1-7. Unfortunately, there is not a way to customize this in a Ranking Grid question.
Check it out in an example survey!
OR
Add a survey with this setup to your account!
This workaround uses the following features:
- Radio Button Grid Question Type
- JavaScript Action
Setup
Start by building out your Radio Button Grid question. Once you've added your question title, row and column headers head over to the Layout tab and scroll to the CSS Class Name field and enter the following class name: onePerColumn.
Next, add a JavaScript action to the same page and paste the below JavaScript and click Save Action.
//Relies on a CSS class name onePerColumn being applied to the table.
$(document).ready(function(){
$(".onePerColumn :radio").change(function(){
var col = $(this).attr("value");
$(".onePerColumn :radio[value='" + col + "']:checked").not(this).each(function(){
$(this).prop('checked',false);
});
});
});
Now, record a few test responses and make sure your validation works as it should!
Scripting and Other Custom Solutions
We’re always happy to help you debug any documented script that is used as is. That said, we do not have the resources to write scripts on demand or to debug a customized script.
If you have customization ideas that you haven't figured out how to tackle, we're happy to be a sounding board for SurveyGizmo features and functionality ideas that might meet your needs. Beyond this, check out our Professional Services; these folks have the scripting chops to help you to achieve what you are looking for!
Admin
— Dave Domagalski on 10/23/2019
@Lu: Thank you so much for your feedback!
I'm glad that this content helped you find a solution. Thanks again!
David
Technical Writer
SurveyGizmo Learning & Development
Admin
— Bri Hillmer on 01/11/2017
@AMP: Within the Radio Button Grid question we have the options to adjust the width of the row header column and a control for all other columns as described here:
https://help.surveygizmo.com/help/radio-buttons-grid#layout-customizations
These are the only built-in controls available. If you need further refinements this is something our programming services team can do for a fee. You can learn more about this service here:
https://www.surveygizmo.com/programming-services/
Bri
Documentation Coordinator
SurveyGizmo Customer Experience Team
— AMP on 01/11/2017
Hi,
I am trying to adjusting the width of the rows and columns of the matrix but it did not work. Please advise how to fix this.
Vincent
Admin
— Bri Hillmer on 11/29/2016
@Benjamin: On the surface, there's not an easy way to modify this existing script to achieve what you describe. It's at least outside of my scripting abilities. It can most certainly be done with JavaScript. This is the kind of customization our Programming Services team does for a fee. You can learn more here:
https://www.surveygizmo.com/programming-services/
Bri
Documentation Coordinator
SurveyGizmo Customer Experience Team
— Sarah on 11/28/2016
Can the same thing be done, but limiting the answers to three per column?
Admin
— Dave Domagalski on 09/08/2016
@Evatsakou: Thank you for your question!
There is not currently a built-in option for this functionality and as such a custom solution would be required. You might consider exploring this option with our Programming Services Team:
https://www.surveygizmo.com/programming-services/
Best regards,
David
Documentation Specialist/Survey Explorer
SurveyGizmo Customer Experience
— Spyridoula on 09/08/2016
Hi, I have the same issue with Kathy and Grant, I want the first column to only allow one option, but the rest of the columns can have multiple rows. Any news or ideas?
Thanks
Admin
— Bri Hillmer on 01/26/2016
@Deane: Unfortunately Custom Tables are an entirely different beast so there's not a quick workaround for using this script with this question type. You might try posting your question to the community and see if there are scripting wizards out there that might be able to help.
Another idea would be to check out one of the websites below. These websites have developers available that can build these features for you.
www.odesk.com
www.rentacoder.com
www.guru.com
I hope this helps!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Deane on 01/26/2016
Hello - Is there any way to use this script and still require all columns to be answered?
I am using it in a custom table with two columns of radio buttons (to enable the same row to be selected in each column, if desired). I can make the overall question required, which requires at least one of the columns to be selected. However, making the column (the Multiple Choice Options) required cannot work with this script, as the former would require all buttons in a column to be selected, and the script prevents this.
Is there any work-around for this? Thank you!
Admin
— Bri Hillmer on 10/13/2015
@Kendall: If you wish to apply this script to two Radio Button questions you'll need to have the questions on separate pages with the script on both pages.
Thanks for checking out our documentation!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Kendall on 10/08/2015
I have 2 radio button grids in a row, and I placed the JavaScript action below these 2 radio button grids (with CSS hook applied). But, now the JavaScript action is applying to both radio button grids at once (i.e. if I make a selection in Column 1 of Question 1, I can't make a selection in Column 1 of Question 2).
Any thoughts on a work-around?
Admin
— Bri Hillmer on 08/26/2015
@Grant: Ah ha. I just reread Kathy's comment and you are correct what I suggested wouldn't work. I'm sorry to say that we don't have a built in option to achieve this. My guess is this script could be modified to achieve this. I will check with Patrick, the author of this article, to see if we can come up with something. Not sure what the turnaround time would be but I will see what I can do!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Grant on 08/25/2015
@Bri: The NA special setting does not disqualify responses for the remainder of the column. It does disqualify the remaining answers in a row when used on a Check Box Grid, but does not disqualify any answers for the Radio Button Grid questions. I am trying to accomplish a goal similar to @Kathy in this thread.
Admin
— Bri Hillmer on 08/24/2015
@Kathy: The NA special setting is available for Radio Button Grid questions. This should just what you describe!
http://help.surveygizmo.com/help/article/link/answer-option-special-settings
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Kathy on 08/20/2015
Is it possible to make one column mutually exclusive? For example if you have a list of beers in the rows and you want them to say how often they drink them....the first column says "I only drink this", but then the second, third and fourth columns have other options that can have more than one beer attributed to them (like "this is one many", "I don't know this one", etc.). So you want the first column to only allow one beer, but the rest of the columns can have multiple rows. Does that make sense?
Admin
— Bri Hillmer on 05/07/2015
@Mdecker: It looks like you signed up for a trial of the Basic account. I switched you over to a Premier trial so you should be able to check out the survey action functionality!
Let us know if we can help with anything else!
Bri
Documentation Coordinator/Survey Sorceress
SurveyGizmo Customer Support
— Mdecker on 05/07/2015
Told that a premier plan is required in order to add action. So much for test period allowing a true test of full functionality.