We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13580
    • 2 Posts
    Hi all

    I have a question related to Formit extra.
    Is there a way to generate a custom css-class to input fields when error is found during the form validation? I would like to color those fields red wich are not valid.

    BR, Jari

    This question has been answered by Jari Kauppila. See the first response.

    • discuss.answer
      • 13580
      • 2 Posts
      Hi

      I found the answer for this from: https://forums.modx.com/thread/47550/formit-example-and-error-highlighting

      So this kind of tag can be used in the css class attribute where "fieldname" is the field to validate against and "errorclass" is the custom css class [[+fi.error.<fieldname>:isnot=``:then=`<errorcssclass>`]]

      When there is something wrong with the validation related to this field it shows the custom class...

      BR, Jari