ryno
Joined: 14 Mar 2008 Posts: 2
|
Posted: Fri Mar 14, 2008 2:31 am Post subject: city state zip in one array not working - need some help |
|
|
I hate having really long forms and new lines for something so small as a zip box... so I'm grouping the City State and Zip together but I'm having problems calling the data out for my mailer.
Default form attributes
| Code: | // Default form attributes
$attsInput = array('size' => 40, 'maxlength' => 40);
$attsInputShorty = array('size' => 15);
$attsTextArea = array('rows' => 3, 'cols' => 30);
$statesList = array("" => "", "AL" => "Alabama", "AK" => "Alaska", "AR" => "Arkansas", "AZ" => "Arizona", "CA" => "California", "CO" => "Colorado", "CT" => "Connecticut", "DE" => "Delaware", "DC" => "Dist of Columbia", "FL" => "Florida", "GA" => "Georgia", "HI" => "Hawaii", "ID" => "Idaho", "IL" => "Illinois", "IN" => "Indiana", "IA" => "Iowa", "KS" => "Kansas", "KY" => "Kentucky", "LA" => "Louisiana", "ME" => "Maine", "MD" => "Maryland", "MA" => "Massachusetts", "MI" => "Michigan", "MN" => "Minnesota", "MS" => "Mississippi", "MO" => "Missouri", "MT" => "Montana", "NE" => "Nebraska", "NV" => "Nevada", "NH" => "New Hampshire", "NJ" => "New Jersey", "NM" => "New Mexico", "NY" => "New York", "NC" => "North Carolina", "ND" => "North Dakota", "OH" => "Ohio", "OK" => "Oklahoma", "OR" => "Oregon", "PA" => "Pennsylvania", "RI" => "Rhode Island", "SC" => "South Carolina", "SD" => "South Dakota", "TN" => "Tennessee", "TX" => "Texas", "UT" => "Utah", "VT" => "Vermont", "VA" => "Virginia", "WA" => "Washington", "WV" => "West Virginia", "WI" => "Wisconsin", "WY" => "Wyoming"); |
Then displayed here:
| Code: | $eleCityStateZip[] = &HTML_QuickForm::createElement('text','txtCity','City',$attsInputShorty);
$eleCityStateZip[] = &HTML_QuickForm::createElement('select','selState','State',$statesList);
$eleCityStateZip[] = &HTML_QuickForm::createElement('text','txtZip','Zip','size="5" maxlength="5"');
$frmSellRV->addGroup($eleCityStateZip,'txtCityStateZip', 'City, State, Zip:'); |
Then trying to display in email here:
| Code: |
<p>' . $varForm['txtAddress'] . '<br>
' . $array_values['txtCity'] . ', ' . $array_values['selState'] . ' ' . $array_values['txtZip'] . '</p>
|
It seems to show the City and Zip fine but I'm losing the state array in there, and I'm thinking it's because of the array within an array.
My email I get has the following in it (notice no state)
| Code: |
1433 Ash St
Phoenix, 12345 |
Help please - need to wrap this project up.. Thanks much in advance![/code] |
|