Re: Quickform group default values
| From: | Alexey Borzov | Date: | Tue, 09 Dec 2003 10:45:04 +0000 |
| Subject: | Re: Quickform group default values | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-9405@lists.php.net to get a copy of this message | ||
Hi!
Graeme Merrall wrote:
I've actually filed this as bug (http://pear.php.net/bugs/bug.php?id=351) but I'm hoping I can get some help in the interim with this as the problem is becoming more critical.This should imply that no one pays attention to bug reports?
I'm creating a groups of form elements that require default values filled in. I've used the same method described at http://marc.theaimsgroup.com/?l=pear-general&m=106554883600317&w=2 I'm having the same issue subsequently described where one group fails to have the default form values filled in. Poking through the code I've confirmed that everything appears to be working correctly but I keep getting myself lost in the code. I've made some cut-down sample code available at http://inetix.com.au/test.php.html which illustrates the problem.I already researched the bug and have a working fix for it. Before I post it, I'd like to give some suggestions. You code actually creates elements with names like 0[field1], 1[field1], etc. This is *extremely* bad idea, f.e. the javascript for advcheckbox elements is completely hosed (with IE 5.5 at least). Consider *not* using purely numeric names, as this can lead to other problems as well. The fix is to change the line if (empty($name)) { to if (0 == strlen($name)) { in HTML_QuickForm::addGroup() method.