[Catalyst] Design of a new form validator

Yuval Kogman nothingmuch at woobling.org
Thu Dec 1 08:13:35 CET 2005


On Thu, Dec 01, 2005 at 00:15:17 +0100, Sebastian Riedel wrote:
>      [% form.as_xml %]
> 
>      [% FOREACH element = form.errors %]
>          <p>
>          [% element %]:<br/>
>          <ul>
>          [% FOREACH message = form.messages(element) %]
>              <li>[% element %]:</li>
>          [% END %]
>          </ul>
>          </p>
>      [% END %]


Please also add


	$form->integrated_errors(1);

	[% form.as_xml %]

should allow you to just style

	.error {
		border: 1px solid red;
	}

and get small div or something around the actual form element, with
the error text just before or after the <input>.

Another thing to add is to please please please allow:

	1. good default error strings (validators know how to compose
	error messages with each other)

	2. as_xml should be easily broken up so that you can layout your
	form more freely:
		
		iterate elements by order

		extract elements by name

		be able to compose groups of elements, and iterate those

-- 
 ()  Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: /me supports the ASCII Ribbon Campaign: neeyah!!!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20051201/74ef50fe/attachment-0001.pgp


More information about the Catalyst mailing list