The phone_number holds an array. So you need to ask the right way:
$msg .=3D "Client Phone:\t" . $data['phone_number']['areacode'] . "-"
.$data['phone_number']['exchange'] . "-" .
$data['phone_number']['last4'];
You stupid A..
:^)
-----Original Message-----
From: aklug-bounce@aklug.org [mailto:aklug-bounce@aklug.org] On Behalf
Of Tim Jordan
Sent: Thursday, July 13, 2006 12:18 PM
To: aklug@aklug.org
Subject: HTML_QuickForm
Slightly off topic -=20
=20
I'm curious is anyone on the list has used HTML_Quickform from PEAR and
could help me out of a hole I'm in?
=20
I'm stuck on how to return the values of a group array so that I can put
the values in an email. =20
=20
This is how I setup the phone number field on my form:
=20
//add phone number grouping
$phone[] =3D
&HTML_QuickForm::createElement('text','areacode',null,'size=3D"3"');
$phone[] =3D
&HTML_QuickForm::createElement('text','exchange',null,'size=3D"3"');
$phone[] =3D
&HTML_QuickForm::createElement('text','last4',null,'size=3D"4"');
$form->addGroup($phone,'phone_number','Phone: ','-');
$form->addGroupRule('$phone','Enter Phone Number','required');
=20
=20
// pull form data into $data variable
$data =3D $form->getSubmitValues();
=20
Then if my form is valid I want the phone number printed in my email:
<snip>
if ($form->validate()) {
$msg =3D "Registration Form \n \n";
$msg .=3D "Client Name:\t$data[first_name] $data[last_name]\n";
$msg .=3D "Client Email:\t$data[email]\n";
$msg .=3D "Client Phone:\$data[phone_number]";
=20
My email looks like this:
=20
Client Name: t Jordan
Client Email: tim@pcs-alaska.com
Client Phone: Array
=20
Any help is very appreciated!
=20
Thanks,
Tim
=20
=20
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Jul 13 21:00:22 2006
This archive was generated by hypermail 2.1.8 : Thu Jul 13 2006 - 21:00:23 AKDT