Problem setting defaults with HTML_QuickFrom select elements

Do you have questions regarding Pecl or Pear? ask here!

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Sun Oct 16, 2005 1:43 am

Problem setting defaults with HTML_QuickFrom select elements

Postby Foxx » Sun Oct 16, 2005 1:45 am

Joined: 16 Oct 2005
Posts: 1

Post16.10.2005 10:41 Quickform setDefaults for select items Reply with quote Edit/Delete this post Delete this post
I have a problem with setting the defaults for select items in my code.

I set the defaults the following way:

'lastname' => 'Lastname',
'type' => '3',
'group' => 'members',
'euros' => '00'

All the defaults show up just fine, except where they are select dropdown menus. (type and group in the above example).

I have tried many different locations for the setDefaults code (absolute beginning, absolute ending, and 10 places in the middle), but it simply won't show up.

When I pass the creating of a new select element by reference to a new variable called $select, than I can set the default value by using $select->setSelected(), but due to the complexity of my code this is not desirable.

I have set the value of a select element before using the setDefaults method succesfully, but now it simply won't work.

My complete code is far too complex to post, but I hope you can give me suggestions none the less.

I'm using HTML_QuickForm 3.2.5.

Return to “PEAR and PECL”

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest