[qf] addRule on static element?
| From: | Skye Poier | Date: | Wed, 11 Jan 2006 08:07:31 +0000 |
| Subject: | [qf] addRule on static element? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22495@lists.php.net to get a copy of this message | ||
Hi, it's me again.
I have a QuickForm page with...
$form->addElement('static', 'username', 'Member ID:');
$form->addElement('password', 'password', 'Enter Password:');
$form->setDefaults(array('username' => $user['username']));
function cm_login_check($elements)
{
$password = $elements[0];
$username = $elements[1];
... check ...
}
... register rule
$form->addRule(array('password', 'username'), 'Incorrect password.', 'login_check');
Well, the cm_login_check isn't getting anything for $elements[1], $username is blank... if I change the static element to a hidden element, it works fine. So that makes me think static elements can't be used in rules. Bug or feature or user error?
Thanks,
Skye