Home » HTML » HTML_QuickForm » Bug #2695
[PATCH] new 'script' element
Details
| Request #2695 | [PATCH] new 'script' element |
|---|---|
| Submitted | 2004-11-04 22:04 UTC |
| From | ieure at php dot net |
| Status | Wont fix |
| Package | HTML_QuickForm |
| PHP Version | 4.3.9 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2004-11-04 22:04 UTC] ieure at php dot net
Description:
------------
This patch implements support for script elements in a
QuickForm.
While it is possible to have script support using the
'html' element, there are problems with this approach:
* It's impossible to generate valid strict html; script
elements can't exist in tables, and html elements are
never rendered outside the containing table.
* Inline code must be manually escaped.
This patch addresses both issues. Script elements are
collected in $_scripts in the renderer, then placed in the
form wherever {scripts} is. Both inline and external
scripts are supported, and inline scripts are escaped.
I hope this submission goes better than my last attempt.
Patch (against CVS) is here:
http://atomized.org/PEAR/Patches/HTML_QuickForm-script.patch
[2004-11-05 21:32 UTC] ieure at php dot net
Script elements may not exist inside table elements. They
need to be grouped together (similar to how hidden inputs
are), regardless of whether they are intended to work on a
specific element, or the form as a whole.
Adding the script markup by hand to the form template
seems to defeat the purpose of having a form class with
subclasses for elements inside it. It's also inflexible
and error-prone.
Would basing this off the base 'element' class be a better
way to go about this?