Re: HTML_Quick FORM populating default data
| From: | Justin Patrin | Date: | Fri, 17 Mar 2006 23:31:20 +0000 |
| Subject: | Re: HTML_Quick FORM populating default data | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23331@lists.php.net to get a copy of this message | ||
On 3/17/06, Atif Khan <wequar98@gmail.com> wrote:
> Actually I did, and no luck
>
You also need to setDefaults wiih the right names. View Source on the
HTML you get back and look at the names of these element in the HTML.
Use those names in setDefaults.
> $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 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.
> >
--
Justin Patrin