• Resolved luisef

    (@luisef)


    I’m using IF conditions to returning a specific text but only can read the first 40 characters.
    Is there any solution to return a longer text?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @luisef

    If you are displaying the text directly into the calculated field, the calculated fields use input tags, and would be visible only the characters the fits into the tag’s width.

    If it is a long text, the correct would be to display the into a third party field like a “HTML Content” field.

    Please, describe your equation.

    Best regards.

    Thread Starter luisef

    (@luisef)

    Hi
    Thank you for the reply.
    This should be the returned text to Case 0
    “The study contains no weaknesses
    Based on this result you should conclude that the trustworthiness of the study is high (90%).
    This means there is a 10% chance that alternative explanations for the effect found are possible.”

    (function(){
    switch(fieldname5){
    case 1: return “number one”;
    case 2: return “number two”;
    case 3: return “number three”;
    case 0: return “Number zero”;
    default: return “”;
    }
    })()

    Plugin Author codepeople

    (@codepeople)

    Hello @luisef

    The solution recommended would be:

    1. Insert a “HTML Content” field in the form with a DIV tag as its content where would be displayed the results, for example:

    <div class="result-here"></div>

    2. Edit the equation as follows:

    
    (function(){
        var result = "";
        switch(fieldname5){
            case 1: result = "number one"; break;
            case 2: result = "number two"; break;
            case 3: result = "number three"; break;
            case 0: result = "The study contains no weaknesses Based on this result you should conclude that the trustworthiness of the study is high (90%). This means there is a 10% chance that alternative explanations for the effect found are possible."; 
            break;
        }
        jQuery('.result-here').html(result);
        return result;
    })()
    

    Finally, as the calculated field is being used as auxiliary, you can tick the checkbox in its setting to hide the field from the public form.

    Best regards.

    Thread Starter luisef

    (@luisef)

    @codepeople
    Thank you very much.
    Ist working fine …. for now.
    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Length of IF returned text’ is closed to new replies.