QuickForm questions +suggestions

From: Date: Tue, 06 Nov 2001 13:54:48 +0000
Subject: QuickForm questions +suggestions
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-2578@lists.php.net to get a copy of this message
Hi, I've just downloaded the QuickForm class and had a little play with it, and now have a few questions and suggestions. Is there any chance of (XML?) config files for each form, so that you just go: $form = new HTML_QuickForm('Test.conf'); ... ... as opposed to specifying the elements in the script? Shouldn't the presentation be abstracted further from the QuickForm class? I would suggest returning an array of the elements and labels for the fields, and then using Table.php to create the table to hold the form. This would also allow people to assign the form elements to block templates/Smarty/etc more easily than at present. I suggest this because I want to do something like the following with the form class. For years, I've believed that the best way to handle form errors is to display an error message, and highlight the area in question as well. I have spent a long time looking for a PHP script to do this, but not found any yet. I believe QuickForm may be the right one, and suggest this as a future addition. If you don't quite follow what I've written above (and I'm not sure that I do!) then have a look at a demo I put together at <http://www.mapledesign.co.uk/form/>. Submit the form how it is, and see how the next page looks. I've cheated and just used two HTML files here, but I'm sure you get the idea of what I'm trying to achieve. It would be really easy to do if an array containing the input elements and text labels was returned by the class, which you could then use Table.php to build into the table. If an error was detected while validating the data, $form[n]["error"] would be set, and when the table is built this variable is looked for. If present, then the properties of the table row could/would be modified, as per the demo. I hope the above is intelligible to you - if not, or you want anything explained in greater detail, please contact me. Regards, Peter. -- Maple Design - web design, custom programming. No job too small. And ridiculously low prices! http://www.mapledesign.co.uk

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