Field Validation error text colour

Field Validation error text colour

TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

Hi Allan,

Is it possible to change the colour of the field validation error text displayed in the following scenarios?

  1. During inline editing.

  2. When the create/new or edit modal popup is displayed.

Regards,
Tom

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi Tom,

    Sure, the DOM structure that Editor uses is documented here and can be used to craft the CSS expressions you want. For example you might use:

    div.DTE_Field div.DTE_Field_Error {
      color: green;
    }
    

    Allan

  • TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

    Hi Allan,

    I can't seem to get this working.

    I can see the div with the DTE_Field class present in the DOM but no mention of any elements with the DTE_Field_Error class present.

    This applies in both cases in my original message.

    Can you assist please?

    Regards,
    Tom

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Hi Tom,

    The DTE_Field_Error class is shown in the first code block on that page - line 10.

    Allan

  • TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

    Hi Allan,

    Thanks but I meant that I can't see any elements in the actual DOM (via the browser developer tools) which have the class name DTE_Field_Error so that I can override the color as per your example.

    Regards,
    Tom

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Odd - they should be right there. If you load this page and then click the "New" button and "select element" in your browser's dev tools for any of the input elements you should see the error element as the next element in the inspector.

    Allan

  • TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

    I should mention that I'm also using Bootstrap.

    I can see your example works as the validation error message has the DTE_Field_Error CSS class associated. In our application a CSS class named help-block takes DTE_Field_Error's place (help-block seems to be defined by Bootstrap).

    Does this make any more sense?

    I can send screenshots if that would help?

    Regards,
    Tom

  • TomB2015TomB2015 Posts: 19Questions: 6Answers: 0

    Hi Allan,

    I've successfully tried adapting the example you provided as follows:

    div.DTE_Field div.help-block {

    color: green;

    }

    Regards,
    Tom

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Ah yes - the Bootstrap part changes it :-). Bootstrap provides classes that Editor uses directly to integrate properly.

    Good to hear you've got it working now!

    Allan

This discussion has been closed.