Slim3 JSP‎ > ‎

errorClass

This function returns the error style class if there is an error for the attribute.
For example:
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>

<input type="text" ${f:text("title")} class="${f:errorClass('title', 'err')}"/>${f:h(errors.title)}

The result:
<input type="text" name="title" value="" class="err"/>title is required.

See demo(Create page) and sample source.

Next...

Continue to errors.



Comments