Static text, after a text entry box that is attached to a multiple choice selection, is slightly off | XM Community
Solved

Static text, after a text entry box that is attached to a multiple choice selection, is slightly off

  • 16 August 2019
  • 2 replies
  • 80 views

So I used the following code that I found on this site to add a " %" symbol after a text entry option. This worked for a question that only had a textbox in it, but not for another question that had two multiple choice (a YES and a NO), with the NO option requiring a numerical input. The percent symbol next to this box was slightly upwards and looks quite odd. This is the code I am using currently:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

var inputs = $(this.getQuestionContainer()).select('input[type="text"]')

var input = inputs[0];
$(input).insert({after: ' %'});
});

And here is an image of what I am seeing:
!

Any help in moving the percent symbol to be more centred would be appreciated.
icon

Best answer by MatinE 16 August 2019, 07:35

View original

2 replies

For anyone dealing with this problem, I found a solution:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place Your Javascript Below This Line*/

var inputs = $(this.getQuestionContainer()).select('input[type="text"]');

var input = inputs[0];
$(input).insert({after: '<span style="line-height:45px">%</span>'});
});

This I assume moves the line that the symbol rests on.
Userlevel 3
Badge +6

MatinE I am having this same issue, but the code you provide above doesn't correct it for me. I don't see a difference between the code you first posted and the solution code above. Help? Thanks!

Leave a Reply