Form text boxes elements | XM Community
Skip to main content

I have 4 text boxes in a form, I apply jQuery as shown below.
jQuery("#"+this.questionId+" input[type='text']:first-child").css("max-width","30%").after(" cm");
jQuery("#"+this.questionId+" input[type='text']:nth-child(2)").css("max-width","30%").after(" kg");
jQuery("#"+this.questionId+" input[type='text']:nth-child(3)").css("max-width","30%").after(" cm");
jQuery("#"+this.questionId+" input[type='text']:last-child").css("max-width","30%").after(" cm");

However, the outputs are the same for the text "cm" after each text box. Weight item should be in "kg".
image.pngWelcome suggestions.



I fixed as follows
jQuery("#"+this.questionId+" input[type='text']:first").css("max-width","30%").after(" cm");
jQuery("#"+this.questionId+" inputttype='text']:eq(1)").css("max-width","30%").after(" kg");
jQuery("#"+this.questionId+" inputttype='text']:eq(2)").css("max-width","30%").after(" cm");
jQuery("#"+this.questionId+" inputttype='text']:last”).css("max-width","30%").after(" cm");




Leave a Reply