We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28120
    • 380 Posts
    I can see how to display an error message if a form field fails validation

    [[!+fi.error.email]]

    but I'd also like to change the color of the input field to red.

    How can I also display something generic if a field fails, e.g.

    [[!+fi.error.email.class]]

    returns

    class="failed"
      • 28120
      • 380 Posts
      Shaun McCormick kindly answered with

      <input id="email" type="text" name="email" value="" class="[[!+fi.error.email:notempty=`my-class`]]"  />