[html-formfu] constraint "required"
Octavian Rasnita
orasnita at gmail.com
Mon Jan 26 13:23:00 GMT 2009
From: "Jens Schwarz" <blacky6767 at gmx.de>
> Hi,
>
> I just discovered, that I use two types of "required" constraints in my Catalyst app. One that looks like ...
>
> - type: Text
> name: foo
> constraints:
> - type: Required
>
> ... and one that looks like ...
>
> - type: Text
> name: foo
> constraints:
> - Required
>
> Both seem to work. Which one is the preferred one?
> --
The second is more simple to use.
The one that should be recommended I think that it is the first because different kinds of constraints can be added without giving errors (at least when using a configuration type like Config::General).
The following code works:
<constraint>
type Required
</constraint>
<constraint>
type Equal
name repeat_password
others password
</constraint>
But the following code doesn't work:
constraint Required
<constraint>
type Equal
name repeat_password
others password
</constraint>
And it might confuse the new users...
Octavian
More information about the HTML-FormFu
mailing list