Re: HTML_Quick FORM populating default data

From: Date: Fri, 17 Mar 2006 23:15:47 +0000
Subject: Re: HTML_Quick FORM populating default data
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-23329@lists.php.net to get a copy of this message
On 3/17/06, Atif Khan <wequar98@gmail.com> wrote: > I am trying to populate data into HTML_quick Form, but > it does not like multiple phone numbers. > > When i try to populate information from DB, everything works fine, except > the phone numbers. It populates the last phone number everywhere. > > After I get the info from the DB, I use > > $ClientForm_obj->setDefaults(array('fname' => $fname, > 'lname' => $lname, > 'address1' => $address1, > 'address2' => $address2, > 'city' => $city, > 'state' => $state, > 'zip_postal' => $zip_postal, > 'w_phone' => $some_number1, > 'h_phone; => $some_number2 > )); > > $areaCode = $ClientForm_obj->createElement('text', '', null, You need to name these elements. > array('size' => 4, > 'maxlength' => 3, > 'onfocus' => > 'this.style.backgroundColor="f4f4e6"', > 'onblur' => > 'this.style.backgroundColor="ffffff"')); > $phoneNo1 = > $ClientForm_obj->createElement('text', '', null, > array('size' => 4, > 'maxlength' => 3, > 'onfocus' => > 'this.style.backgroundColor="f4f4e6"', > 'onblur' => > 'this.style.backgroundColor="ffffff"')); > $phoneNo2 = > $ClientForm_obj->createElement('text', '', null, > array('size' => 4, > 'maxlength' => 4, > 'onfocus' => > 'this.style.backgroundColor="f4f4e6"', > 'onblur' => > 'this.style.backgroundColor="ffffff"')); > > $ClientForm_obj->addGroup(array($areaCode, $phoneNo1, $phoneNo2), > 'w_phone', 'Work Phone:', ' - '); > $ClientForm_obj->addGroup(array($areaCode, $phoneNo1, $phoneNo2), > 'h_phone', 'Home Phone:', ' - '); > $ClientForm_obj->addGroup(array($areaCode, $phoneNo1, $phoneNo2), > 'c_phone', 'Cell Phone:', ' - '); > > But it keeps populating $some_number2 to all w_phone, h_phone, c_phone ? > > Y is that ? > > Thanks > Atif K > > > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Justin Patrin

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