• Resolved hheyhey568

    (@hheyhey568)


    Hello CFF Team,
    Is there any way in which I can show superscript or subscript in the field name?
    I have many units of measurement which I want to show with superscript like m2,ft2,km2 etc.

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

    (@codepeople)

    Hello @hheyhey568

    Yes, you can use HTML tags in the fields labels, like m<sup>2<sup>.

    Best regards.

    Thread Starter hheyhey568

    (@hheyhey568)

    Hello,
    Thank you for reply.
    For following case , I want to just make 2 as superscript of ft. How to write it pls?
    Btu/hr ft2 F.

    • This reply was modified 2 years, 10 months ago by hheyhey568.
    Plugin Author codepeople

    (@codepeople)

    Hello @hheyhey568

    The information to include in the field’s label would be: Btu/hr ft<sup>2</sup> F

    Best regards.

    Thread Starter hheyhey568

    (@hheyhey568)

    Thanks a lot.
    I have some of the field which are having change label code which changes the label.

    Can we update the change label method with code which also takes care of superscript?

    Plugin Author codepeople

    (@codepeople)

    Hello @hheyhey568

    I’m sorry, I will need additional details. Please, indicate the code you are using to modify the field’s label.

    Best regards.

    Thread Starter hheyhey568

    (@hheyhey568)

    Hello Team,
    following is the code being used to change the label text.
    Can we superscript 3 ?

    (function(){
        var l = getField(3).jQueryRef().find('label');
              
        if(fieldname2=='fps') l.text('lb/ft3)');
        if(fieldname2=='si') l.text('kg/m3');
       
    
    })()
    Plugin Author codepeople

    (@codepeople)

    Hello @hheyhey568

    If you use the .text jQuery method the html tags are encoded as texts. The correct would be:

    l.html('lb/ft<sup>3</sup>');

    Best regards.

    Thread Starter hheyhey568

    (@hheyhey568)

    Hello Team,
    Thanks for the reply.
    One more question: Lets say I want the label of certail field to change as per the label of other fieldname.
    For example:

    fieldname1 label= deg C
    fieldname2 label= deg F

    (function(){
    var l = getField(3).jQueryRef().find(‘label’);

    l.text(‘lb/ft3)’,fieldname1 label,fieldname2 label);

    })()

    In above example , I want that the label of fieldname3 becomes lb/ft3 , deg C , deg F

    Is it possible? Please guide.

    Plugin Author codepeople

    (@codepeople)

    Hello,

    Yes, of course, that’s possible. You can implement the equation as follows:

    
    (function(){
    var l1 = getField(fieldname1|n).jQueryRef().find('label').html(),
        l2 = getField(fieldname2|n).jQueryRef().find('label').html();
    
    getField(3).jQueryRef().find('label').html('lb/ft3,'+l1+','+l2);
    })()
    

    If you don’t vary the labels of the fieldname1 and fieldname2 fields at the runtime as you are doing with the fieldname3 label, the previous equation would be simpler:

    getField(3).jQueryRef().find('label').html('lb/ft3,'+getField(fieldname1|n).title+','+getField(fieldname2|n).title);

    Best regards.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Superscript and Subscript in field name’ is closed to new replies.