How can I change the background for readonly fields

  • Profile Image
    davsun55
    Asked on February 08, 2018 at 05:29 PM

    I would like my readonly fields to have a light grey background so that they do not look like they can be edited.

    Is this possible?

  • Profile Image
    Kevin_G
    Answered on February 08, 2018 at 07:52 PM

    Yes, it's possible to achieve that with some CSS code, please inject this one to achieve it: 

    .form-readonly, input[readonly=true]{

        background: lightgrey !important;

    }

    This guide will help you injecting the code to your form: https://www.jotform.com/help/117-How-to-Inject-Custom-CSS-Codes 

    I hope this helps. 

  • Profile Image
    davsun55
    Answered on February 08, 2018 at 08:09 PM

    That's great and works, but I've got some calculated fields that are also readonly that this code doesn't affect.

    Can I get them grey too? An example is the 'Total beds' field above.

    Tks

  • Profile Image
    davsun55
    Answered on February 08, 2018 at 08:31 PM

    Actually, I notice that even though the calculated fields don't appear greyed-out in the editor, they do when live. So all good.