How to reduce size of form fields | XM Community
Skip to main content

Hello! I wish to reduce the size of the form field entry boxes but am unable to do so. So far, the methods I’ve tried include:

  1. Dragging the boxes to the size I want (150px x 29px)
  2. Using a JavaScript

The survey theme has always been blank, so I’m not particularly certain how to troubleshoot this. I currently have an existing JavaScript to add the dollar sign in front of each entry box

var inputs = $(this.getQuestionContainer()).select('inputntype="text"]');

for (var i = 0; i < inputs.length; i++) {
var input = inputspi];
$(input).insert({before: '$'});

After removing the existing JavaScript  and retrying the two methods mentioned previously, the answer boxes still remain too big. Below is a screenshot of how the question appears on Qualtrics;

I would like for the text box to be smaller and in line with the dollar sign. Is it possible to do so? Thank you!

Hey @mincme  are you using the simple layout?, if yes, then it might restrict some of the Javascript as it not so custom coding friendly. Flat or Classic layout works best with the below code.

 

Qualtrics.SurveyEngine.addOnload(function() {
    var inputs = $(this.getQuestionContainer()).select('inputitype="text"]');
    for (var i = 0; i < inputs.length; i++) {
        var input = inputsui];
        $(input).insert({before: '$'});
        $(input).setStyle({
            'display': 'inline-block',
            'width': 'auto',
            'margin-left': '0.25em'
        });
    }
});


Leave a Reply