Zen Cart Logo
Forums / General Questions / When double clicking zip code in Firefox, I get an extra leading space

When double clicking zip code in Firefox, I get an extra leading space

Views: 899

Results 1 to 7 of 7
4 Jun 2013, 2:19 PM
#1
phuz avatar

phuz

New Zenner

Join Date:
Jul 2012
Posts:
11
Plugin Contributions:
0

When double clicking zip code in Firefox, I get an extra leading space

Not sure what is going on here, but this is only happening in Zen Cart, specifically with the zip codes on the packing slip / invoice.
It's not a big deal, but it is bugging me and I want to resolve it.

If I double click the ZIP to select it, only the 5 digits are selected and nothing more; however, if I paste it into something, there is always a leading space. If I right click on the selection and choose "View Selection Source" there are 3 extra spaces before the zip so the blue box showing my selection shows " 90210" and it makes no sense. There are a total of 4 spaces between the state and the zip code when looking at the source. Obviously this is a formatting problem with Zen Cart's code but I don't know where to look to remedy this.

I'm hoping some of you code gurus will know where to look.

4 Jun 2013, 3:41 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: When double clicking zip code in Firefox, I get an extra leading space

Try to click and hold left mouse button down to the right of the zip code and move mouse across to the front of the zip code to highlight then copy ...

The double click is picking up what is in the HTML display and you are getting the extra spaces in there ...

4 Jun 2013, 5:40 PM
#3
phuz avatar

phuz

New Zenner

Join Date:
Jul 2012
Posts:
11
Plugin Contributions:
0

Re: When double clicking zip code in Firefox, I get an extra leading space

Ajeh:

Try to click and hold left mouse button down to the right of the zip code and move mouse across to the front of the zip code to highlight then copy ...

The double click is picking up what is in the HTML display and you are getting the extra spaces in there ...

Yes, I know that method works, but why does double clicking pick up unwanted HTML? Any way to remedy this?

4 Jun 2013, 6:41 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: When double clicking zip code in Firefox, I get an extra leading space

You could edit the table:
address_format

and remove the extra spaces before the postcode in the address_format for address_format_id 2 and then the double click on the zip code should work for you without the spaces ...

However, the USPS guide to addresses does prefer the extra space before the postcode, according to their rules ...
http://pe.usps.com/cpim/ftp/pubs/pub28/pub28.pdf

Note: Despite their rules, I do not see the extra space in their examples of it and, the single space is "acceptable", so, you might call the Post Office with any specific questions on this

5 Jun 2013, 11:19 AM
#5
phuz avatar

phuz

New Zenner

Join Date:
Jul 2012
Posts:
11
Plugin Contributions:
0

Re: When double clicking zip code in Firefox, I get an extra leading space

Ajeh:

You could edit the table:
address_format

and remove the extra spaces before the postcode in the address_format for address_format_id 2 and then the double click on the zip code should work for you without the spaces ...

However, the USPS guide to addresses does prefer the extra space before the postcode, according to their rules ...
http://pe.usps.com/cpim/ftp/pubs/pub28/pub28.pdf

Note: Despite their rules, I do not see the extra space in their examples of it and, the single space is "acceptable", so, you might call the Post Office with any specific questions on this

Actually, USPS website is the one barking at me. If I post a zip code that has the leading space, it gives an error stating invalid ZIP, and I completely agree.

Thanks for the hint on the table. What file is that hiding in?

5 Jun 2013, 12:57 PM
#6
phuz avatar

phuz

New Zenner

Join Date:
Jul 2012
Posts:
11
Plugin Contributions:
0

Re: When double clicking zip code in Firefox, I get an extra leading space

Seriously, you can't edit your own posts on this forum? Ouch.

Anyway, found the table in MySQL and modified the column. It works now! So why are there 4 spaces by default when you only need one?

5 Jun 2013, 2:39 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: When double clicking zip code in Firefox, I get an extra leading space

Long inherited code to meet with USPS desire for extra spaces between the state and zip code ...

This only appears to be a problem when trying to double click on the displayed zip code as it picks up the extra spaces ...