• Resolved Marin Marinov

    (@mpmarinov)


    Hello,

    I would like to ask how I can dynamically change the background of a calculated field with a button?

    I have tried the following, but it does not work.

    • my calculated field is number 4
    • in my button under OnClick event I put the following:
      getField(4).jQueryRef().removeClass(‘red green orange’).addClass(‘green’);

    My Button is also for the calculate for the form.

    in my CSS is the following:

    #fbuilder .red .cff-calculated-field input{background-color:#fccbc8 !important;}
    #fbuilder .green .cff-calculated-field input{background-color:#90ee90 !important;}
    #fbuilder .orange .cff-calculated-field input{background-color:#f6d77a !important;}

    Where is the error?

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @mpmarinov

    The error is in the CSS styles block. The correct is:


    #fbuilder .red.cff-calculated-field input{background-color:#fccbc8 !important;}
    #fbuilder .green.cff-calculated-field input{background-color:#90ee90 !important;}
    #fbuilder .orange.cff-calculated-field input{background-color:#f6d77a !important;}

    Without space between the red, green, or orange class names and cff-calculated-field because you are applying both class names to the same tag. You assign the red, green, or orange class name to a tag that has the cff-calculated-field class name assigned.

    Best regards.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.