On Thu, May 14, 2009 at 04:40:24AM -0700, patrick wrote: > I am validating a hidden field in my form using a custom validator. > This hidden field gets populated using the YUI javascript > autocompleter function, which is tied to a text field. > > My problem is that - if the validation fails - formencode sends the > error message to the hidden field whereas I need it to send it to the > text field. > > How do I specify a error message target field, which differs from the > field that is validated?
This doesn't answer your direct question, but it solves your problem: put a <form:error name="yourhiddenfield"> marker next to the visible field (either in front or after it, depending on which style of error reporting you chose). If you're not using <form:error> already, this may mean that you'll need to change the initial form presentation to also be filtered through htmlfill to strip those tags from the output Marius Gedminas -- A: Because it makes the logic of the discussion difficult to follow. Q: Why shouldn't I top post? A: No. Q: Should I top post?
signature.asc
Description: Digital signature
