Discussions

Expand all | Collapse all

Change default field background color- on form in display record mode

  • 1.  Change default field background color- on form in display record mode

    Posted 07-07-2018 07:39
    Hi,
    In edit mode, the fields have a white background so look good in the browser.
    In display mode, the fields have a grey background - not so good for some formula rich text fields, that display info based on choices in my app.

    Using this works well, but still leaves a small grey border-
    "<div style=\"background-color:white;\">"&

    if I could make that border white, then the field looks totally clear, apart from text. Hoping someone can tell me how to make background and the border white/ clear.
    Tried this, but it only adds another border:
    "<div style=\"background-color:white;border: 20px solid White;\">"&

    Many thanks.


  • 2.  RE: Change default field background color- on form in display record mode

    Posted 07-08-2018 08:23
    It is the containing <td> that is setting the background of the cell not the contents of the cell. So there is no formula that will change the background of the containing <td>. You have to use script to change the background using this line of code:
    $("table.LabelsLeft td.cell").css({backgroundColor: "white"});
    You can try this line of code by pasting it into the console and then implement it using the IOL technique.


  • 3.  RE: Change default field background color- on form in display record mode

    Posted 07-18-2018 07:52
    Thanks Dan. 
    Seems to be a lot you can do with IOL and BOL so thought I better start with IOL as seems a little safer for a noob. Questions:
    1. Any security risk with others being able to run scripts with either of these techniques, and access info they shouldn't?
    2. I assume these techniques are fine to use with app tokens.


  • 4.  RE: Change default field background color- on form in display record mode

    Posted 07-18-2018 10:43
    1) Only an admin can setup the IOL technique so it is safe as long as you trust your admin.

    2) yes


  • 5.  RE: Change default field background color- on form in display record mode

    Posted 07-18-2018 12:53
    Thank you.


  • 6.  RE: Change default field background color- on form in display record mode

    Posted 08-25-2018 11:19
    Hi, I tried adding this code and I think I have made a mistake.

    The background is still grey. The iol technique is fantastic & i have used it to improve the framing of the app (https://community.quickbase.com/quickbase/topics/best-way-to-frame-app-and-remove-all-headers)

    Added this line to code page from above:
    $("table.LabelsLeft td.cell").css({backgroundColor: "white"});




  • 7.  RE: Change default field background color- on form in display record mode

    Posted 08-29-2018 07:39
    You can try this line of code by pasting it into the console and then implement it using the IOL technique."

    Hi Dan,
    I have not been able to get this to work. What do you mean by pasting into console as I have just added the line to the codepage that already loads the iol
    Thanks




  • 8.  RE: Change default field background color- on form in display record mode

    Posted 08-30-2018 10:05
    Apologies - your code works as stated. However it only works if you have section headings on the forms set as: 'to the left of fields' and not 'above fields'.

    This was really frustrating me and took a long time to figure out why it wasn't working as I have almost all forms set to above fields.

    Any advice on how to get it working on both types of section headings would be great, but this is still a big improvement from the standard view form with they grey backgrounds so many thanks yet again!


  • 9.  RE: Change default field background color- on form in display record mode

    Posted 08-30-2018 18:27
    Try this for labels above:
    $("table.LabelsAbove div.cell").css({backgroundColor: "white"});


  • 10.  RE: Change default field background color- on form in display record mode

    Posted 08-31-2018 01:04
    Worked perfectly - thank you