Joined: 16 Oct 2005
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.