This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
jQuery(document).keydown(function (event) { | |
if (event.keyCode === 9) { | |
event.preventDefault(); | |
return false; | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
var qid = '#' + this.questionId; | |
var words = ['i', 'love', 'hate', 'swimming', 'is', 'what', 'better']; | |
function init() { | |
showOptions(); // rmeove this if you want to just add the options manually in the question | |
jQuery(qid + ' input[type="text"]').blur(function() { | |
jQuery(qid + ' .ValidationError').hide(); | |
if (textIsValid(jQuery(this).val())) { | |
jQuery('#NextButton').attr('disabled', false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
jQuery('#' + this.questionId).hide(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function () { | |
this.questionclick = function(event,element) { | |
if (element.type == 'radio') { | |
var el = document.getElementById(element.id); | |
var parent = el.parentElement; | |
var img = parent.querySelector('span img'); | |
Qualtrics.SurveyEngine.setEmbeddedData('Winner', img.id); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imgId = '#Falcon'; | |
var width = jQuery(imgId).width(); | |
var scaleFactor = '${e://Field/scaleFactor}'; | |
var newWidth = width * scaleFactor; | |
jQuery(imgId).width(newWidth); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
var regex = /(my text string)|(my other text string)/gi; | |
var fieldName = 'FieldName'; | |
// add listener to text boxes | |
jQuery('#' + this.questionId + ' textarea').on('blur', function() { | |
// Find the value typed in textbox | |
var value = jQuery(this).val(); | |
if (value.match(regex)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
// may need to modify these | |
var pickGroupQID = 'QID5'; // this is the qid of the Pick, Group, and Rank question | |
var numberOfGroups = 3; // how many groups do you have? | |
// add listeners to text boxes | |
for (var i = 1; i < numberOfGroups + 1; i++) { | |
var selector1 = '#' + this.questionId + ' .ChoiceStructure table tr:nth-child(' + i + ') input'; | |
// store the group number for recall within event handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Qualtrics.SurveyEngine.addOnload(function() { | |
// Qualtrics.SurveyEngine.setEmbeddedData('${q://QID18/ChoiceNumericEntryValue/3}', 67); // impossible | |
var x =34; | |
document.getElementById("demo1").innerHTML = x; | |
}); |