homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

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

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


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.





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

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 Jun 11, 2013 (gmt 0)

Oh dear!

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved