Discussion:
[FE-discuss] List of all errors encountered in a form
J***@js3d.Co.Uk
2009-02-04 22:13:04 UTC
Permalink
Hi,

Is there an easy way to access any errors which may have been flagged in a
schema in a final chained validator? I want to insert a generic message at
the top of the page letting the user know that the form has errors.
I was approaching this through a custom chained_validator but I'm unsure of
what value to test against to see if any errors have allready occoured,
error_dict dosen't seem to exist. This is in pylons using @validate
decorator.

An alternative [hacky ]fix to my problem and also something I'm having no
luck with would be to be able to anchor to the top of the form when the
page is reloaded, but I've no idea how to achieve it.

Any help much appreciated.

Jules

--------------------------------------------------------------------
mail2web.com – What can On Demand Business Solutions do for you?
http://link.mail2web.com/Business/SharePoint
Ian Bicking
2009-02-04 23:43:00 UTC
Permalink
Post by J***@js3d.Co.Uk
Hi,
Is there an easy way to access any errors which may have been flagged in a
schema in a final chained validator? I want to insert a generic message at
the top of the page letting the user know that the form has errors.
I was approaching this through a custom chained_validator but I'm unsure of
what value to test against to see if any errors have allready occoured,
decorator.
Chained validators don't have access to previous errors. The actual
validation produces an exception that contains all the errors. @validate
then runs those through htmlfill. I'm not sure if there's a way to get into
@validate; you might want to ask on the Pylons list.
Post by J***@js3d.Co.Uk
An alternative [hacky ]fix to my problem and also something I'm having no
luck with would be to be able to anchor to the top of the form when the
page is reloaded, but I've no idea how to achieve it.
I'm not sure what you mean? Oh, like redirect to #top? You could change to
<form action="page#top">; for successful submissions that shouldn't do
anything, but for unsuccessful submissions you'd go to the top.
--
Ian Bicking | http://blog.ianbicking.org
Brennan Todd
2009-02-05 00:32:03 UTC
Permalink
I just checked the pylons @validate (
http://pylonshq.com/project/pylonshq/browser/pylons/decorators/__init__.py),
and it places the entire errors dictionary into c.form_errors.
Post by Ian Bicking
Post by J***@js3d.Co.Uk
Hi,
Is there an easy way to access any errors which may have been flagged in a
schema in a final chained validator? I want to insert a generic message at
the top of the page letting the user know that the form has errors.
I was approaching this through a custom chained_validator but I'm unsure of
what value to test against to see if any errors have allready occoured,
decorator.
Chained validators don't have access to previous errors. The actual
then runs those through htmlfill. I'm not sure if there's a way to get into
@validate; you might want to ask on the Pylons list.
Post by J***@js3d.Co.Uk
An alternative [hacky ]fix to my problem and also something I'm having no
luck with would be to be able to anchor to the top of the form when the
page is reloaded, but I've no idea how to achieve it.
I'm not sure what you mean? Oh, like redirect to #top? You could change
to <form action="page#top">; for successful submissions that shouldn't do
anything, but for unsuccessful submissions you'd go to the top.
--
Ian Bicking | http://blog.ianbicking.org
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with
Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code
to
build responsive, highly engaging applications that combine the power of
local
resources and data with the reach of the web. Download the Adobe AIR SDK
and
Ajax docs to start building applications today-
http://p.sf.net/sfu/adobe-com
_______________________________________________
FormEncode-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/formencode-discuss
Loading...