Quickform - multiple rows
| From: | Obsessed | Date: | Fri, 25 Mar 2005 09:51:42 +0000 |
| Subject: | Quickform - multiple rows | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-18324@lists.php.net to get a copy of this message | ||
I'm trying to create a list with usernames and emails.
The email field is a textfield that is editable, so the admin can change the emailaddres. on each row we have a label, textfield with email and a (submit) button.
Now I'm trying to get all the correct emails from the database and into the textfields. Now here is the problem, I keep getting the same email (from the last user in array) in all my textfields.
Here is some code the array users contains other arrays with username and email in them
$users = db_GetUsers();
$formusers = new HTML_QuickForm('frmEditUser', 'post');
$formusers->addElement('header', 'UserHeader', 'Overzicht Medewerkers');
foreach($users as $user)
{
$formusers->addElement('text', 'email', $user['username']);
$formusers->addElement('submit', btnEdit', 'Wijzig');
$formusers->addElement('submit', 'btnDelete', 'Verwijderen');
$formusers->setDefaults($user);
}
thx