Hello friends,
I have a page that allows a user to enter a shipping address; it is presently set up with a text field to allow entry for state. However, I have an additional administrative page that collects address info from all completed orders and formats it for upload to my FedEx.com address book.
I'm having some issues because the field for state is a text field, and some folks are entering the full state name. FedEx.com rejects this as invalid - they want the 2 letter abbreviation (eg. IA instead of Iowa). Thus far, I have been manually updating the file before upload. I'm getting tired of doing this, as it is tedious and time-consuming, so I decided to alter the form to use a drop down that shows the states' names, but outputs the 2-letter abbreviation as the value.
Here's the code I had previously:
So far so good - it's worked consistently. So I decide to create the drop-down on a blank page and copy it over; I typically use dreamweaver, and the origianl designer used a templating tool, so the form will not display graphically in Dreamweaver. The page is generated dynamically using a template class.
So I create the following code in dreamweaver:
to replace this:
And I get an error:
Line 27 in my code is the first option value line. I'm sure it should be easy to figure out, and yet, my brain is starting to sting a little, and there's blood coming out my left ear. I'm sure it has to do with the variable - do I declare and set the variable AFTER declaring the checkbox and possible values?
I'd appreciate a fresh set of eyes.
Regards,
Nedstar1
I have a page that allows a user to enter a shipping address; it is presently set up with a text field to allow entry for state. However, I have an additional administrative page that collects address info from all completed orders and formats it for upload to my FedEx.com address book.
I'm having some issues because the field for state is a text field, and some folks are entering the full state name. FedEx.com rejects this as invalid - they want the 2 letter abbreviation (eg. IA instead of Iowa). Thus far, I have been manually updating the file before upload. I'm getting tired of doing this, as it is tedious and time-consuming, so I decided to alter the form to use a drop down that shows the states' names, but outputs the 2-letter abbreviation as the value.
Here's the code I had previously:
Code:
<form action='zmax_address_confirmation.php' method='post'>
<table width='75%' border='0' cellspacing='0' cellpadding='3'>
<tr>
<td width='46%'><span class='style1'>Address 1 *</span></td>
<td width='54%'><input name='address1' type='text' value='$address1' id='address1' size='50' /></td>
</tr>
<tr>
<td><span class='style1'>Address 2 </span></td>
<td><input name='address2' type='text' value='$address2' id='address2' size='50' /></td>
</tr>
<tr>
<td><span class='style1'>City *</span></td>
<td><input name='city' type='text' value='$city' id='city' size='30' /></td>
</tr>
<tr>
<td><span class='style1'>State *</span></td>
<td><input name='state' type='text' value='$state' id='state' size='30' /></td>
</tr>
<tr>
<td><span class='style1'>Zip or Postal Code *</span></td>
<td><input name='zip_postal' type='text' value='$zip_postal' id='zip_postal' size='25' /></td>
</tr>
<tr>
<td><span class='style1'>Contact Telephone Number *</span></td>
<td><input name='telnum' type='text' value='$telnum' id='telnum' size='25' /></td>
</tr>
<tr>
<td> </td>
<td><input type='submit' value='Submit' /></td>
</tr>
</table>
</form>
<p><b>NOTE</b>: We cannot deliver to P.O. Boxes.</p>
</form>
So far so good - it's worked consistently. So I decide to create the drop-down on a blank page and copy it over; I typically use dreamweaver, and the origianl designer used a templating tool, so the form will not display graphically in Dreamweaver. The page is generated dynamically using a template class.
So I create the following code in dreamweaver:
Code:
<select name="state" id="state" value='$state'>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
//etc etc etc
<option value="WI">Wisconsin</option>
<option value="WY">Wyoming</option>
</select>
to replace this:
Code:
<input name='state' type='text' value='$state' id='state' size='30' />
And I get an error:
Code:
Parse error: parse error, unexpected T_STRING in address.php on line 27
Line 27 in my code is the first option value line. I'm sure it should be easy to figure out, and yet, my brain is starting to sting a little, and there's blood coming out my left ear. I'm sure it has to do with the variable - do I declare and set the variable AFTER declaring the checkbox and possible values?
I'd appreciate a fresh set of eyes.
Regards,
Nedstar1