Re: Quickform - edit form

From: Date: Wed, 09 Mar 2005 22:03:13 +0000
Subject: Re: Quickform - edit form
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-210375@lists.php.net to get a copy of this message
Leonie (phpgroup) wrote:
I've set up a form using Quickform. I've got it working a dream. My problem is at the moment it only adds records to the database. I would like to also have an edit form. I don't know what is easiest. Amend the existing form so it enters data and edits it, or have two different webpages. Also I'm having trouble working out how to assign data to the form. Can anyone point me to an example?
Use either HTML_QuickForm::setDefaults() to set defaults for all elements or HTML_QuickForm_element::setValue() to set value for individual elements. Former is simpler, and if you name the forms elements after the table columns, you can directly pass in array fetched from sql query.

« previous php.general (#210375) next »