RE: [PEAR] [HTML/QuickForm] How can I override a textfield's value?

From: Date: Wed, 03 Mar 2004 22:58:38 +0000
Subject: RE: [PEAR] [HTML/QuickForm] How can I override a textfield's value?
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-11090@lists.php.net to get a copy of this message
Hi! setConstants is your friend ... buildForm (to setup the form and to enable getting the values) getdataset (Select data from a database or whatever) setConstants (set the values) display Form why don't u just try some examples from the docu first? regards Daniel - also "made in Germany" which ... seem to have lost a lot of it's meaning :-) > I have a ListBox containing some values (in my case some > people's names): > > $form->addElement('select', 'name', 'Select Name: ', > $name_arr, array('onChange' => 'document.myForm.submit()')); > > As you can see the form is sent back to the webserver > immediately when a value from the ListBox is selected. After > that, I would like to show the entire dataset of the selected > name underneath my ListBox, being able to edit and change the > dataset's values in textfields. When I call my page, I can > only see the ListBox. I select a value and the form is > extended showing me the entire info I want to see, that means > the form's textfields contain the values from my selected > dataset. That's fine. But now, when I select a different name > from the ListBox, the textfields still contain the values > from the previous dataset. That's logical, because the form > always tries to display the values that were contained in the > textfields when the form was sent. But how can I override > these values? I have already spent hours on that. Please help.

« previous php.pear.general (#11090) next »