Hello,
I’d like partipants to answer “ first 2 letter of first name” & ‘first 3 letter of last name’ in the from field. How can I validate so that they can only enter 2 letters and 3 letters on that field?
Hello,
I’d like partipants to answer “ first 2 letter of first name” & ‘first 3 letter of last name’ in the from field. How can I validate so that they can only enter 2 letters and 3 letters on that field?
Hi
Qualtrics.SurveyEngine.addOnload(function() {
jQuery('#'+this.questionId+' input').slice(0, 3).each(function(index) {
var maxLength;
if (index === 0 || index === 2) {
maxLength = 2;
} else {
maxLength = 3;
}
jQuery(this).on('input', function() {
var value = jQuery(this).val();
if (value.length > maxLength) {
jQuery(this).val(value.slice(0, maxLength));
}
});
});
});
Try this code.
Hope this helps!
Thank you so much! It worked kind.
Kindly mark it as best answer if it worked for you
Thanks
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.