Forum Discussion

GwenPeters's avatar
GwenPeters
Qrew Member
6 years ago

Changing Field Color Based on Checked Box

I have a set of date fields that I would like to change the background color once a box is checked indicating that the task is complete.  Would love some help with this if it's possible.

Thank you!

-g

------------------------------
Gwen Peters
------------------------------
  • You could use a formula rich text field:

    If([checkbox1]=true,
    "<span style=background-color:#00ff00;><b>"&ToText([field4])&"</b></span>",
    ToText([field4]))

    Unchecked:

    Checked:

    You can use dynamic form rules to show/hide the original date field and include an edit checkbox so the user can change the date field if needed:


    Date field is blank:

    Date field is not blank:

    Date field is not blank AND checkbox is checked:

    Date field is not blank AND checkbox is checked and Edit is checked:





    ------------------------------
    Adam Keever
    ------------------------------
    • GwenPeters's avatar
      GwenPeters
      Qrew Member
      Thank you Adam. I will try this tomorrow and let you know if any of the options work.  

      I am a new QB user and truly appreciate the support!

      -g

      ------------------------------
      Gwen Peters
      ------------------------------
  • AustinK's avatar
    AustinK
    Qrew Commander
    What Adam posted was along my initial thinking as well, it would work.

    There may be other solutions to this that are more user/UI friendly.

    One thing I was just thinking of would be if you had hidden fields next to each field you want to show as completed. Similar to what Adam posted but have them only show up when a checkbox after each section is clicked, or at the end of the form even. You could do this per field, which would get a little out of hand very quickly, or per section. MY example here is going to be very simple but hopefully it helps to illustrate my point. IT has a form rule that is essentially "when Section 1 - Date is no blank and Section 1 - Finished Checkbox is checked, show Section 1 - Validated". You could have other conditions in there as well.

    With an alternate label showing no names this would look much better, I also picked a rather large icon.

    And obviously nothing is shown as valid if there is no date. However it does not prevent submission in that case, you could add it in.

    Hopefully that helps to show another option.
    • GwenPeters's avatar
      GwenPeters
      Qrew Member
      Thanks Adam!  I'll try all options tomorrow and let you know what works.

      ------------------------------
      Gwen Peters
      ------------------------------