Re: HTML_Quick FORM populating default data
| From: | Atif Khan | Date: | Fri, 17 Mar 2006 23:22:12 +0000 |
| Subject: | Re: HTML_Quick FORM populating default data | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23330@lists.php.net to get a copy of this message | ||
Actually I did, and no luck
$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', 'areacode', null,
array('size' => 4,
'maxlength' => 3,
'onfocus' => 'this.style.backgroundColor="f4f4e6"',
'onblur' => 'this.style.backgroundColor="ffffff"'));
$phoneNo1 = $ClientForm_obj->createElement('text', 'prefex', null,
array('size' => 4,
'maxlength' => 3,
'onfocus' => 'this.style.backgroundColor="f4f4e6"',
'onblur' => 'this.style.backgroundColor="ffffff"'));
$phoneNo2 = $ClientForm_obj->createElement('text', 'number', 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:', ' - ');
Justin Patrin wrote:
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 useYou need to name these elements.$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,-- Justin Patrinarray('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