Problems with select in HTML_QuickForm

From: Date: Tue, 04 Dec 2001 10:09:40 +0000
Subject: Problems with select in HTML_QuickForm
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-3342@lists.php.net to get a copy of this message
Hi Adam, hi all, At the moment, when one want to put a select into a form using HTML_QuickForm, it has to be done this way : $form->addElement('select', 'language', $languages, 'Choose language:'); Where $languages is an array of this kind : $languages['Anglais'] = 'English'; $languages['Français'] = 'French'; As you might notice, the key will be displayed in the select as an option to choose from while the value is what will actually be selected. So user will see 'Anglais' and 'English' will be selected. I think this is not good in a multilingual application. One might expect to use the opposite: $languages['French'] = 'Français' and then just change the value instead of the key. This would also be better as most of the times, labels of select can have special chars in them. So I suggest we change the way select works. If you have any complaints about that, please let me know. Thanks Bertrand Mansion Mamasam

« previous php.pear.dev (#3342) next »