JavaScript - Changing alignment of text entry boxes within a side-by-side question

Danny12077Danny12077 Community Member - Trial User Qubie ✭

JavaScript - Changing alignment of text entry boxes within a side-by-side question

Hi,

I have a side-by-side question with a column of short text entry boxes. I've used the following code to add text after the boxes:-

for (var i = 0; i < inputs.length; i++) {

 var input = inputs[i];

$(input).insert({after: list[i]});

}

As a result my table now looks like this.

I've tried using this code to align the boxes to the left, so they'd all be straight.

jQuery("#"+this.questionId+"  .ChoiceStructure").css("text-align","left");

I replaced this.questionId with the ID of the specific field, but no luck.

Does anyone have experience with this?

Answers

  • rondevrondev Community Member - Trial User Wizard ✭✭✭✭✭
    edited May 7

    Try the below code:

    for (var i = 0; i < inputs.length; i++) {
     var input = inputs[i];
    $(input).insert({after: list[i]});
    $(input).parent().css("text-align","left");
    
    }
    

    OR

    Check this

Sign In to Comment