Welcome to the LimeSurvey Community Forum

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

How to make one column in an array text question "readonly"?

  • SherriChen
  • SherriChen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 10 months ago #185917 by SherriChen
Hi Joffm,

Yes, I agree with you. But I am working on a complex questionnaire including many questions of respondents' history. For example, in this case, the original question is asking about people's illness history. The table will contain "illness" "When were you diagnosed with this illness?" "Have you recovered from this illness?" "If yes, when did you recover from this illness?" "Relapse or not?" The questions are continuous and we don't know how many experiences the respondent has. So I think it's better to achieve it in an array. If Limesurvey cannot do this, I will choose your solution. Thank you!
The topic has been locked.
  • SherriChen
  • SherriChen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 10 months ago #185928 by SherriChen
Hi,

Good news! I think I have solved this problem with the following code:

<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('input[ name="{SGQ}SQ001_SQ002"]').change(function() {
$('input[ name="{SGQ}SQ001_SQ003"]').prop('disabled', true);
$('input[name="{SGQ}SQ001_SQ003"]').val("");
if ($('input[ name="{SGQ}SQ001_SQ002"]').val()=="3") {
$('input[ name="{SGQ}SQ001_SQ003"]').prop('disabled', false);
$('input[name="{SGQ}SQ001_SQ003"]').val("");
}
});

});

</script>


:laugh:
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose