Welcome to WebmasterWorld Guest from 54.167.159.180

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How to deal with HTML drop-down boxes after "Google Translate"?

     
3:23 pm on Jun 11, 2013 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 26, 2004
posts: 137
votes: 0


Hi,

I have a form at my checkout with a simple country selection box. e.g.:

"<select id="del_country" name="del_country"><option selected>Australia</option><option >Austria</option>..."

The selected country gets posted back to my PHP to decode the selection. This all works fine until a user visits my site using google translate. The selection is returned to me in the translated language, which is currently meaningless. What's a good way around this?

Although not completely ruled out, I'm trying to achieve this without using javascript.

Regards,

Jez.
3:30 pm on June 11, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 15, 2003
posts:938
votes: 25


You should use the 'value' attribute in the <option> tag, as in:

<option value="Australia" selected>Australia</option>

The value attribute will not be translated by Google.
4:17 pm on June 11, 2013 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 26, 2004
posts: 137
votes: 0


Oh dear!

I've had the code in place for so long I completely missed value was missing. Thanks very much.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members