This document is based on questions asked on PEAR general mailing list. You are encouraged to search the list archives to find more verbose answers and examples.
Recent versions of HTML_QuickForm package require HTML_Common package version 1.2.1
(CVS revision 1.8 in
HTML/Common.php) to work properly. If
(and only if) an older version of HTML_Common is loaded, these symptoms occur.
Please note that
$ pear list
command may tell you that you have HTML_Common 1.2.1 installed.
In this case you also have an older version of HTML_Common somewhere and are including it instead
of the proper one. Check your
include_path setting in
and/or use PHP's get_included_files()
function to find out which file you are really including.
of HTML_QuickForm accepts a
Setting this to TRUE will make QuickForm check whether the form was actually submitted.
This also helps if you have several forms defined on one page.
$form->addElement('date', 'foo', 'The date:', array('format' => 'Y m d'));
Thus you pass the defaults as an array, just like you do with any other group:
'foo' => array('Y' => 2004, 'm' => 9, 'd' => 29)
To ease using it with database-backed applications, date element also accepts Unix timestamps (generated by mktime()) and strings. The strings are processed by strtotime() functions, so consider its limitations.
"Call to a member function on a non-object"or
"Undefined function"errors, especially when dealing with groups.
These errors tend to appear when you have something which is not a
HTML_QuickForm_element in the
passed to addGroup().
This "something" is usually either a PEAR_Error instance (check for these
or setup a handler) or, if
register_globals is switched on in
some submitted values (clear the array before adding elements to it).
QuickForm does add a
'name' attribute to the
which is invalid in XHTML Strict. Quickform does not depend on that attribute since release 3.2.2, and it's only
kept for backwards compatibility. If you desire XHTML Strict compliance and your code does not depend
on said attribute, you can remove it via removeAttribute() method.
'required'rule does not work for my elements!