PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm2 » Bug #2535

Getting a list of element names and their rules

Details

Request #2535Getting a list of element names and their rules
Submitted2004-10-15 13:51 UTC
Fromstrauchdieb at gmx dot de
Assignedavb
StatusClosed
PackageHTML_QuickForm2
PHP VersionIrrelevant
OSIrrelevant
Roadmaps(Not assigned)

Comments

[2004-10-15 13: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

[2004-10-16 00: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).