multiple choice -> text entry | XM Community
Solved

multiple choice -> text entry

  • 23 May 2019
  • 1 reply
  • 1 view

Userlevel 2
Badge +3
!
How to make this text box only enter a positive integer from 0 to 100?
thanks a lot.
icon

Best answer by fleb 23 May 2019, 09:52

View original

1 reply

Userlevel 5
Badge +6
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