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

    (@codepeople)

    Hello @graicifyd,

    The solution depends on the project. For example, assuming you know the maximum possible value of the calculated field.

    I’ll try to describe the process with an hypothetical example:

    Assuming the equation is: fieldname1+fieldname2 and you know the maximum possible value of the equation is 1000

    First, insert a “HTML Content” field in the form with a piece of code similar to the following one, as its content:

    
    <div style="width:100%;height:20px;border:1px solid green;"><div id="my_progress" style="height:20px; background: green;width:0;float:left;"></div></div>
    

    Second, edit the equation associated to the calculated field as follows:

    
    (function(){
        var result = fieldname1+fieldname2;
        jQuery('#my_progress').css('width', MIN(result*100/1000, 100)+'%');
        return result;
    })()    
    

    and that’s all.
    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display Calculated Field as a Slider or a Progress bar’ is closed to new replies.