Community Groups are officially here!
We've released Groups, a new feature that enables us to connect community members of similar industries and interests in a shared, private space. You can check out all of the details here, including information about who can join, how to join, and what Groups are currently offered. Please leave your feedback through this Community Groups Feedback Survey.

How do you enter fixed text after each text box in form type?

SLEE
SLEE Community Member Qubie ✭
edited May 7 in Custom Code


How do you add static text after each text box in the form text type? Also, how do you add inequality signs for "greater than or equal to" or "smaller than or equal to" in the same static text?

Best Answer

  • rondev
    rondev Community Member Wizard ✭✭✭✭✭
    Accepted Answer

    Use the below code

    jQuery("<span>>=<span>").insertAfter("#"+this.questionId+" .InputText:eq(0)");
        jQuery("<span><=<span>").insertAfter("#"+this.questionId+" .InputText:eq(1)");
    

Answers

  • SLEE
    SLEE Community Member Qubie ✭

    Thank you again. Where am I supposed to add the fixed text in the code?

  • rondev
    rondev Community Member Wizard ✭✭✭✭✭

    @SLEE said:
    Thank you again. Where am I supposed to add the fixed text in the code?

    Between the span tag <span>HERE</span>

  • noncoder
    noncoder AustraliaCommunity Member - Trial User Qubie ✭
    edited May 2

    I want to add the '%' sign after a free text box.

    Last week I managed to add units after free text boxes using this script.

    The same java script doesn't appear to be working when I tried to do it for a new question today. Can anyone assist?

    Qualtrics.SurveyEngine.addOnload(function()

    {

    var inputs = $(this.getQuestionContainer()).select('input[type="text"]');

     

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

     var input = inputs[i];

     $(input).insert({after: ' %'});

    }


    });


    Qualtrics.SurveyEngine.addOnReady(function()

    {

    /*Place your JavaScript here to run when the page is fully displayed*/


    });


    Qualtrics.SurveyEngine.addOnUnload(function()

    {

    /*Place your JavaScript here to run when the page is unloaded*/


    });