PEAR is archived and read-only

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

Home » HTML » HTML_QuickForm » Bug #810

When all form elements are of password type quickform returns errors

Details

Submitted2004-02-20 14:36 UTC
Fromcarlos_serapio at yahoo dot com
StatusNo Feedback
PackageHTML_QuickForm
PHP Version4.3.4
OSredhat linux
Roadmaps(Not assigned)

Comments

[2004-02-20 14:36 UTC] carlos_serapio at yahoo dot com

Description:
------------
if all of the form visible elements are of "password" type quickforms returns a fatal error.

if you simply change one of the types to "text" the code works.

NOTE: the qf_set_templates() function that's shown in the code is irrelevant, it just places the template on the form. I can assure it has nothing to do with the error because i placed an echo (while testing) after it and it "echoed". If necessary, i can put the rest of the code. i didn't do it now because it would pass the 20 lines of code limit.

Reproduce code:
---------------
$pwdfrm = new HTML_QuickForm("password", "post");
qf_set_templates($pwdfrm, $qftpl); //<- this doesn't really matter
$pwdfrm->setRequiredNote('');

$pwdfrm->addElement("password", "opassword", "Current Password");
$pwdfrm->addElement("password", "npassword", "New Password");
$pwdfrm->addElement("password", "cpassword", "Confirm New Password");
$pwdfrm->addElement("hidden", "used", "1");

$frmgroup[] = &HTML_QuickForm::createElement('submit', 'btnSubmit', trim('Change Password'));

$pwdfrm->addGroup($frmgroup, NULL, NULL, ' ');
unset ($frmgroup);

$pwdfrm->applyFilter("__ALL__", "trim");
$pwdfrm->addRule("opassword", "Current Password Required.", 'required');
$pwdfrm->addRule("npassword", "A new password is required.", 'required');
$pwdfrm->addRule("cpassword", "You must confirm the new password.", 'required');

echo $pwdfrm->toHtml();

Expected result:
----------------
a form with three password fields and a submit button.

Actual result:
--------------
Fatal error: Cannot instantiate non-existent class: html_quickform_password in /usr/lib/php/HTML/QuickForm.php on line 489