[cgiapp] Re: Custom Error Messages - CGI::Applicaiton::Plugin::ValidateRM

Mark Stosberg mark at summersault.com
Mon Aug 10 20:11:41 EDT 2009


On Mon, 03 Aug 2009 14:54:10 -0700
adam at spatialsystems.org wrote:

> I have a <textarea> field to evaluate and peg errors line by line.  So
> if line 2 and line 5 are invalid, I want to note that as two different
> errors.

It is normal for fields to have more than one constraint, with the possiblity
that more than one of them can fail at a time. Usually this is still considered one
constraint with one name, but the error messages get appended together. 

If you want separate tokens for each error message, then that's another story.
You could use a field_filter to split the text area into multiple fields before it gets
processed by the constraint_methods, and then define unique constraints for each line.

    Mark

-- 
http://mark.stosberg.com/





More information about the cgiapp mailing list