Skip to content Skip to sidebar Skip to footer

Javascript To Change The Size Of Qualtrics Text Box

Qualtrics used to have a section of their website called Coder's Corner that had snippets of code that could be used to advance the functionality of the surveys but they did away w

Solution 1:

The answers given don't specifically apply to a Qualtrics constant sum question. I think the code below is what you are looking for. Change "75px" to the desired width.

Qualtrics.SurveyEngine.addOnload(function()
{
    var inputWidth = "75px";
    $(this.questionId).select('.SumInput').each(function(name, index) {
        name.style.width = inputWidth;
    });
    $(this.questionId).select('.SumTotal').each(function(name, index) {
        name.style.width = inputWidth;
    }); 
    $(this.questionId).select('.InputText').each(function(name, index) {
        name.style.width = inputWidth;
    });
});

I don't believe the specific code above was ever included on the Qualtrics javascript page. I've made a number of Qualtrics javascripts publicly available at https://gist.github.com/marketinview/

Solution 2:

This code should do what you are looking to do:

functionmakeBigger(){ 
var txt = document.getelementbyid('txtbox');
txt.style['width'] = '100px';
 }

Click here for more info

Post a Comment for "Javascript To Change The Size Of Qualtrics Text Box"