Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.0

Request #2535 Getting a list of element names and their rules
Submitted: 2004-10-15 08:51 UTC Modified: 2006-06-08 08:16 UTC
From: strauchdieb at gmx dot de Assigned:
Status: Open Package: HTML_QuickForm2
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: strauchdieb at gmx dot de
New email:
PHP Version: Package Version: OS:

 

 [2004-10-15 08:51 UTC] strauchdieb at gmx dot de
Description: ------------ I want to retrieve the element names as an array. I wrote a method getElementNames() that returns the keys of $_elementIndex This is especially useful in addition to the new insertElementBefore function. Furthermore I want to get a list of rules for each element. For this I wrote the method getElementRules() that returns the $_rules array. I made a diff patch with the current stable version of HTML_QuickForm. You can see it at http://www.gildehaus-hannover.de/QuickForm.diff

Comments

 [2004-10-15 12:57 UTC] avb
::scratches head:: Can you give an example of real-life situation where these methods will actually be useful?
 [2004-10-15 19:04 UTC] strauchdieb at gmx dot de
I am building an editor for forms where you can enter labels, element types and validation in a tabular view (one row = one table element). After submitting these values, I want to iterate over the elements for setting each label, type and validation rule. Without the element names it's difficult to iterate over the form elements. Additionally, if you want to change the element order, you have to know the original order, which element comes after each element. So the element list is only one possibility to get iteration capabilities. If you want a more DOM-like approach, I could implement something like nextElement (similar to nextSibling).
 [2006-06-08 08:16 UTC] avb (Alexey Borzov)
Moving feature requests to HTML_QuickForm2.