multiple choice -> text entry | XM Community
Skip to main content
!
How to make this text box only enter a positive integer from 0 to 100?
thanks a lot.
Hi @Cathaya,
what about this?

Qualtrics.SurveyEngine.addOnload(function()
{
var input = jQuery("#"+this.questionId+" .InputText");
input.attr('type', 'number');
input.on('input', function() {
this.value = this.value.replace(/e/g, '');
if(Number(this.value) >100) this.value = 100});
});

I've modified the code from @TomG mentioned here.

Leave a Reply