Side-By-Side - only allow one answer per row (statement)
Validation for a Side-By-Side - I have two columns, with options on the left (Col 1), a statement, and then options on the right (Col 2). I want to only allow them to choose one item per row (statement)...so only one in either Col 1 or Col 2.
NOTE: I can do it using a lot of custom validation with tons of conditions (I have a LOT of statements), so i’m looking for a more elegant (less tedious) way. I dreamt of using a total count by column - but it isn’t available. I tried scoring, but I can’t do a validation based on the score…
Anyone have any ideas? Very open to J/S solutions
Page 1 / 1
HI there Marty K,
Can you share a QSF or screen shot of one of the questions?
Thank you!
Sorry, forgot to ask if you were set on side by side or if you would consider other question types?
Thanks for asking! The question needs match the look and feel - I tried matrix, but could only get one choice on each side.
But with Side by Side I could get the correct look and feel needed:
But then each column is considered independently so I can’t have it be only one choice per row. Definitely would take a different question type IF it could give the appearance in Test 2 (above)
Maybe this?
Doing a little more research on the forums it seems that the side by side is column based for the questions (vs. row) and if row manipulation was needed the users either went to a matrix question or used work arounds, i.e. the long way.
I think if you want to keep the view you have and already have the work arounds, even though it’s more time consuming, that would be the route to go.
Interested to see if anyone else weighs in, I’m not versed in J/S but if someone else is that could potentially streamline it.
If the question is about showing 2 items to the respondent and asking them to pick the extent they lean toward one or the other, you might be able to use a Bipolar matrix:
Without the availability of setChoiceValue() for Side-By-Side questions, I think the only way a radio button can be deselected is by selecting another radio button within that column. So you'd either have to include a Not Applicable option within each column and use JavaScript to select it when an option in the other column is selected, or use checkboxes which can be checked and unchecked with JavaScript directly to enforce exclusivity across the row.
For the checkbox option, for both columns in the Side-By-Side, try changing the answer type to Multiple Answer (checkboxes) and then add the below to the question's JavaScript in the OnReady section. It will uncheck other checkboxes in a row except the one being clicked on:
Qualtrics.SurveyEngine.addOnReady(function() { /*Place your JavaScript here to run when the page is fully displayed*/ const rows = document.querySelectorAll('.Choice');
Thanks guys. Yes, it would be great if they would accept the Bipolar or Matrix look and feel! I think it will come down to them choosing to do the tedium of setting up the validation (not bad with 1 row, but with 10 or more it could be a LOT of work).
I will DEFINITELY try the Java@Tom_1842 IF that works I’ll owe you a donut (coffee, pastry of your choice, beer...your choice)!
Woot Woot! I owe you @Tom_1842 !
Thanks @pamelalbeck !
That worked! I DEFINITELY need to document that. SO much better for my customer. No validation to put in, it won’t allow two in a row! Thanks again,