- Posts: 419
- Thank you received: 34
Ask the community, share ideas, and connect with other LimeSurvey users!
<script> jQuery(document).ready( function(){ var lockit = '{DisableThem.NAOK}'; if (lockit) == 'Y' { document.getElementById("answer458485X809X13701").readOnly=true; } else { document.getElementById("answer458485X809X13701").readOnly=false; } } ); </script>
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { var lockit = '{DisableThem.NAOK}'; if (lockit == 'Y') { $("#answer123432X6804X55061").prop('readonly', true); } else { $("#answer123432X6804X55061").prop('readonly', false); } }); </script>
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { $('#question{QID} input:text').prop('readonly', true); }); </script>
Question theme ?tpartner wrote: You could also do it with a custom question theme.
<input class="form-control {{kpclass}}" type="text" name="{{name}}" id="answer{{name}}" value="{{dispVal}}" {% if inputsize is not empty %} size="{{inputsize}}" {% endif %} {% if maxlength is not empty %} maxlength='{{maxlength}}' {% endif %} readonly="readonly" aria-labelledby="ls-question-text-{{basename}}" />