Home » HTML » HTML_QuickForm » Bug #4433
insertBeforeElement and HTML pseudo element gives trouble
Details
| Submitted | 2005-05-25 20:16 UTC |
|---|---|
| From | php at pinna dot nl |
| Status | No Feedback |
| Package | HTML_QuickForm |
| PHP Version | 5.0.3 |
| OS | Linux 2.4 |
| Roadmaps | (Not assigned) |
Comments
[2005-05-25 20:16 UTC] php at pinna dot nl
Description:
------------
Trying to insert a html type element before some other elements. Somehow this goes wrong...
It gives an error on QuickForm.php line 646 which has an array_search statement.
The problem is, that a html element doesnt have a name. So currentName, which resolves to $element->getName() returns nothing...
I cannot easily reproduce the code here but I'm almost sure thats the problem.
It happens only if the last element of the _elements array is html it seems...
I made my own workaround by bypassing the else statement if the type is html...
anyway, maybe its an idea, i don't know if its possible but anyway, to give the html pseudo element a name...
I know the name can't be put in the html, but maybe until the real rendering to html begins, it's usefull for these questions.
[2005-05-31 15:17 UTC] php at pinna dot nl
Well, it uses DB_DataObject_FormBuilder, so I don't know if I can manage to get some handsome reproduce code... I'll try to add it.
[2005-05-31 15:27 UTC] php at pinna dot nl
Reproducing code can be found on: http://www.syslogic.nl/~junior/php/quickform-html-bug.phps
Again, it uses FormBuilder so it's maybe a bit more work to get the code work.
The problem is that FOrmBuilder automatically builds a form which is what I call vertically based. 2 columns, left the field label, right the input field.
I want get rid of the label and get all input fields on one line.
Therefore I create each element with another template, which doesnt use a new <tr> for each field. But I cannot include the <tr> for the new row, so I want to add that afterwards.
I add a HTML element, which gives back a reference. I use that reference to get insertElementBefore work...
Hope its clear.
I still think its not a formbuilder bug...