Adding symbols/characters after/before Text Entry in Multiple Choice type question | XM Community

Adding symbols/characters after/before Text Entry in Multiple Choice type question

  • 4 October 2022
  • 8 replies
  • 303 views

Userlevel 1
Badge +2

Just want to insert the "%" sign after the text box. I have already a sample code I used on other question type. But this one is not working . See attached file
Here's my code
jQuery("#"+this.questionId+" .TextEntryBox .InputText").css("width","96%").after(" %");
Here's the code in the inspect element:
image.png
From this
image.pngTo this
image.png



8 replies

Userlevel 6
Badge +27

Use the below code:
jQuery("#"+this.questionId+" .TextEntryBox.InputText").css("width","96%").after("%");

Userlevel 1
Badge +2

https://community.qualtrics.com/XMcommunity/discussion/comment/50346#Comment_50346Your code is same as mine above. This code wont work. Thank you for your response.

Userlevel 6
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/50348#Comment_50348There should be no space between .TextEntryBox and .InputText

Userlevel 1
Badge +2

https://community.qualtrics.com/XMcommunity/discussion/comment/50350#Comment_50350it works now. Thank you Shashi

Userlevel 1
Badge +2

https://community.qualtrics.com/XMcommunity/discussion/comment/50346#Comment_50346how about for this html code. Which selector will I be using?
image.png

Userlevel 6
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/50355#Comment_50355jQuery("#"+this.questionId+" .InputText").css("width","96%").after("%");
Try the above.

Userlevel 4
Badge +16

Thank you so much Shashi for continuously helping out the community and providing a working solution! 🙂

Userlevel 2
Badge +3

@Shashi Is there a way to modify this code so the text is before the text entry box? I tried changing “after” to “before” but the text was still after the text box. 

Thank you! 

Leave a Reply