one simple question:
Why this code works perfectly in FF and IE and in Chrome it doesn't?
<select class="langbox" name="forma">
<option class="text-option" onClick="window.location = 'http://www.myurl/it'" >Italiano</option>
<option class="text-option" onClick="window.location = 'http://www.myurl/en'" >English</option>
<option class="text-option" onClick="window.location = 'http://www.myurl/de'" >Deutsch</option>
<option class="text-option" onClick="window.location = 'http://www.myurl/fr'" >Français</option>
<option class="text-option" onClick="window.location = 'http://www.myurl/ru'" >Pусский </option>
</select>
It doesn't redirect me on the url I want, it does nothing on Chrome. In Firefox and IE it works.
<select class="langbox" name="forma" onChange="window.location
='http://www.myurl/'+this.options[this.selectedIndex].value;">
<option class="text-option" value="it">Italiano</option>
<option class="text-option" value="en">English</option>
<option class="text-option" value="de">Deutsch</option>
<option class="text-option" value="fr">Français</option>
<option class="text-option" value="ru">Pусский</option>
</select>
You don't click on options, you change the select. While some browsers may be tolerant of this, others may not be (as you have discovered). Especially mobile browsers, which may have a completely different UI for <select> elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With