Hi, I want to make my front page country selector page. i have this code which works fine earlier but now it is not working, is there any issue in this code? This code is about when a visitor visit my site he will see a page with dropdown country selection form where he can choose his country and hit the button Go and it will open/redirect the link of that country he chose. For example i have a site name “example.com” and i also have this website for USA, UK, UAE. so when a visitor choose UK he will redirect to the link “uk.example.com” and same for the others i-e usa.example.com and uae.example.com. If the following code is not correct please guide me or if possible please correct this code, it will be very grateful to you. i also attached reference pictures.
BELOW IS THE CODE:
<html>
<body>
<form>
<select name=”list” id=”list” accesskey=”target”>
<option value=’none’ selected>Choose your country</option>
<option value=”us.example.com”>United States</option>
<option value=”uk.example.com”>United kingdom</option>
<option value=”uae.example.com”>United Arab Emirates</option>
</select>
<input class=”favorite” type=button value=”Go” onclick=”goToNewPage()” />
</form>
<script type=”text/javascript”>
function goToNewPage()
{
var url = document.getElementById(‘list’).value;
if(url != ‘none’) {
window.location = url;
}
}
</script>
</body>
</html>
Attachments:
You must be
logged in to view attached files.