Grails : Tag - validate
This page last changed on Feb 17, 2006 by [email protected].
Tag - validate
DescriptionAllows client-side validation of domain class constraints against a form. Parameters
ExamplesExample domain class: class User { @Property String login @Property String pwd @Property constraints = { login(length:5..15,unique:true) pwd(length:5..15) } }
The below used submits to a "login" action. The field names match those within the class defined about: <form name="userForm" action="login"> <input type="text" name="login" /> <input type="password" name="pwd" /> </form>
This allows us to apply the validate tag against the constraints set in the domain class and produce the necessary <g:validate form="userForm" against="User" />
|
Document generated by Confluence on Mar 29, 2006 08:46 |