How to change the Label color for required field alert

  • Profile Image
    oxinst
    Asked on April 10, 2013 at 07:39 AM

    Hi, what CSS would I need to change the 'Label' color, when the form is submitted and it is a required field alert.  I have the red border that alerts around the field, but I also want to turn the label for the field to red.  This is just when it is a required field alert, nornally the text would be blue.

    Thanks

  • Profile Image
    sidharth_kch
    Answered on April 10, 2013 at 08:51 AM

    @oxinst

    Please inject the following custom css to change the label font color: 

    .form-label-left, .form-label-right, .form-label-top{color: red !important;}

    This css changes the color to red, feel free to change to any color or your choice. 

    Follow this guide on : How to Inject Custom CSS Codes

    Please let us know if you need further assistance.

    Thanks,

    Sidharth

  • Profile Image
    oxinst
    Answered on April 10, 2013 at 10:36 AM

    @sidharth_kch

    Thanks for your reply, but I just want to change the color of the label when form is submitted and the required fields have not been completed.  So in normal state the Label is blue, but if the form is submitted and the field has not been completed, I want the Label to turn to red.


    Thanks

  • Profile Image
    sidharth_kch
    Answered on April 10, 2013 at 11:18 AM

    @oxinst

    I will have to get back to you on this. I have sent a message to my colleague on your requirement.

    Thanks,

    Sidharth

  • Profile Image
    EltonCris
    Answered on April 10, 2013 at 04:09 PM

    Ok, use this CSS.

     

    .form-line-error .form-label-top {

    color: red;

    }

    Hope this helps. Thanks!

  • Profile Image
    oxinst
    Answered on April 11, 2013 at 05:17 AM

    Perfect! Working great.  Thanks