I have a survey where I pass a URL Parameter called "DisableThem" to the first question in my survey (where value is either Y or empty).
If DisableThem = "Y", I'd like to set several short text response fields to disabled -- so that the values cannot be editted (this is because several questions are also prepopulated with parameters passed to the survey under some conditions.
I still want to show these questions and the response values, but I don't want the participant to be able to edit the responses.
I'm thinking some javascript to check the value of DisableThem and then jquery to change the question input to disabled could work, but I'm not sure how to do this.
Is it possible?
Something like this, but it's not working, so I'm doing something wrong:
Code:
<script>
jQuery(document).ready(
function(){
var lockit = '{DisableThem.NAOK}';
if (lockit) == 'Y' {
document.getElementById("answer458485X809X13701").readOnly=true;
} else {
document.getElementById("answer458485X809X13701").readOnly=false;
}
}
);
</script>