formerror

Templating System : Designer Guide : Tag Reference : formerror

Summary

The formerror tag is used to specify the presentation of a form validation error.

Usage

  <formtemplate id="add_user">
  <table>
  <tr>
    <td>First Name</td>
    <td>
      <formwidget id="first_name">
      <formerror id="first_name" type="no_special_characters">
      The first name may not not contain special characters such as 
      @, $, !, %, & or #.
      </formerror>
    </td>
  </tr>
  </table><br>
  <input type="submit" value="Submit">
  </formtemplate>

Another example:

  <formtemplate id="add_user">
  <table>
  <tr>
    <td>First Name</td>
    <td>
      <formwidget id="first_name">
    </td>
  </tr>
  <formerror id="first_name">
  <tr>
    <td colspan="2"><font color="red">@formerror.first_name@</font></td>
  </tr>
  </formerror>
  </table><br>
  <input type="submit" value="Submit">
  </formtemplate>

This adds another table row which contains the error message for that widget in red color. If there is no error then the table row will not be added.

Notes