I’m trying to add a checkbox with the words “This does not apply to me” after a form field question (just below Reason 5):
I tried using the following code, but it’s not showing the checkbox. I’ve also confirmed I’m using the correct QID. Any suggestions are appreciated!
<script>
Qualtrics.SurveyEngine.addOnload(function() {
// Get the form field question by its question ID
var formFieldQuestionId = 'QID37'; // Replace 'QID37' with the actual question ID
var formFieldQuestion = $(formFieldQuestionId);
// Create a new checkbox element
var checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.id = 'myCheckbox';
checkbox.name = 'myCheckbox';
// Create a label for the checkbox
var label = document.createElement('label');
label.htmlFor = 'myCheckbox';
label.appendChild(document.createTextNode('This does not apply to me'));
// Insert the checkbox and label after the form field question
formFieldQuestion.insertAdjacentElement('afterend', checkbox);
formFieldQuestion.insertAdjacentElement('afterend', label);
});
</script>