Welcome to the LimeSurvey Community Forum

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

[SOLVED]: How to disable some radio buttons in array

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 6 months ago #231653 by blocka
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.28.23+220809
Own server or LimeSurvey hosting: own
Survey theme/template: Vanilla
==================
I have an array where I want some radio buttons in some rows to be disabled so the user cannot select them. Is there a way to do this?

Please Log in to join the conversation.

  • blocka
  • blocka's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 6 months ago #231654 by blocka
Ah, I figured it out.. Use JavaScript and reference the id element:
Code:
 <script>
$(document).ready(function() {
$('input[id="answer549811X1396X21828q5a-3"]').attr('disabled', 'disabled');
$('input[id="answer549811X1396X21828q5a-5"]').attr('disabled', 'disabled');
});
</script>

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose