Re: HTML_Quick FORM populating default data

From: Date: Fri, 17 Mar 2006 23:53:50 +0000
Subject: Re: HTML_Quick FORM populating default data
References: 1 2 3 4 5  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23333@lists.php.net to get a copy of this message
On 3/17/06, Atif Khan <wequar98@gmail.com> wrote: > Here is the HTML source. I cleaned up all the array options so its easier to read. > Notice the default I set only for w_phone[areacode], but it populates it on h_phone also. > > You're using PHP5 aren't you? In PHP5 Objects are passed by referenced by default. This means that you're adding the *same* object instance to 2 different groups and that when the areacode is set in one, it's set in the other. Use clone() in your addGroup calls around the elements. -- Justin Patrin

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