Re: More error problems with QuickForm

From: Date: Sun, 04 May 2003 14:36:03 +0000
Subject: Re: More error problems with QuickForm
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-15830@lists.php.net to get a copy of this message
On Sun, 2003-05-04 at 15:22, Alexey Borzov wrote: > Hi! > > Jon Wood wrote: > > Ok, I've got the list of errors working now, but I'm trying to just mark > > fields with errors in the main form by putting a symbol next to them, > > instead of the full error text (since that's already at the top). > > Well, currently ITDynamic works like this: > 1) If there is an error block near the element, then assign a error message else > store it into the $_errors property > 2) If $_errors is not empty, then display the errrors in qf_error_loop block. > > This essentially means that the error will be displayed only once: either in the > form itself or above the form. If you want to display it *twice*, you have to > tweak the logic of the renderer. Is there any reason for it being set like this? It seems to make more sense to assign it to _errors whatever happens, and then the user can choose where they want errors simply by including/not including the relevant blocks, instead of rummaging around in the QuickForm renderers. While they're not the most complicated piece of code I've ever seen, I still think it makes sense that in the context of a PEAR package the user shouldn't have to make any changes to the code unless they want to do something *very* different... and I don't really think that whether you display errors in one or two (clearly defined) places is a huge question. I can also imagine this being something that lots of people want to do, since I'm currently making it display a form like this: There were some errors, please correct the fields marked !. - You must enter a name Name ![__________] Address [Whatever ] Phone [123456789 ] -- Jon Wood jon@jellybob.co.uk www.godaintpants.co.uk/users/Jellybob "Experience is something you don't get until just after you need it."

« previous php.pear.dev (#15830) next »