How do you remove the space between the fixed text before the text box and the text box? | XM Community
Solved

How do you remove the space between the fixed text before the text box and the text box?


!
I'm using Form as the text type in the response. I want to have a dollar sign to come before each text box, but the space between the dollar sign and the text box (indicated by the red box in the figure) does not go away.

I tried "Add Default Choices" and pre-populated the dollar sign in the text box, but that's not how I want. I don't want the participants to be able to remove the dollar sign.
icon

Best answer by rondev 1 February 2020, 08:09

View original

10 replies

Userlevel 7
Badge +22
Put space in Form field and add below code in JS onReady

`jQuery("<span>$<span>").insertBefore("#"+this.questionId+" .InputText");`
Thanks for the response, but I'm not trying to get rid of the entire space before the text box. I still would like to put a dollar sign. How would I do that?
Userlevel 7
Badge +22
> @SLEE said:
> Thanks for the response, but I'm not trying to get rid of the entire space before the text box. I still would like to put a dollar sign. How would I do that?

If you want to have a little space before textbox then just change to this `<span>$ </span>`
Thank you! I'm getting somewhere finally.

Two more issues though:
!

1. How do I align the text boxes to the left?
2. the greater than or equal to sign shows up as ">=" How do I make this into a proper inequality sign that has > stacked on the top of =?
Userlevel 7
Badge +22
For 1. Add the below code to existing code:

jQuery("#"+this.questionId+" .ChoiceStructure table tr:eq(0) td:eq(0)").hide();
jQuery("#"+this.questionId+". ChoiceStructure table tr:eq(1) td:eq(0)").hide();

For 2. Use `≥` `≤` for greater than or equal to and smaller than or equal to respectively.
Thank you! the alignment however, didn't work...
!
Userlevel 7
Badge +22
> @SLEE said:
> Thank you! the alignment however, didn't work...
> !
>

Hope you have pasted both the below lines

jQuery("#"+this.questionId+" .ChoiceStructure table tr:eq(0) td:eq(0)").hide();
jQuery("#"+this.questionId+". ChoiceStructure table tr:eq(1) td:eq(0)").hide();
Yes. The following is what I have done. Again, thank you for your help!
!
Userlevel 7
Badge +22
> @SLEE said:
> Yes. The following is what I have done. Again, thank you for your help!

In the last line there is no space before .ChoiceStructure

Please add as seen on third line
Thank you so much! It all works!

Leave a Reply