Look at the website:http://weconvex.com/
The drop down section left to twitter and linkedin symbols. In this, when i choose any option, it goes to that given url but default value of select box does not change. How to change the value according to that.
For example, I choose United States, it redirects to the http://weconvex.com/united-states but values of the select box remains australia. How to correct it. Does it need any jquery code? Please explain in detail.
Thanks.
Hi,
Just use the selected attribute to select the option that should be displayed on page load.
E.g.
<select>
<option value="">Australia</option>
<option value="" [B][COLOR="#FF0000"]selected[/COLOR][/B]>United states</option>
<option value="">Singapore</option>
<option value="">India</option>
</select>
Have you checked my site http://weconvex.com.
In that, at the top left to twitter symbol. I have tried it. But not working. Many people said it will not work after page load.
Do you know any other solution?
Yes.
What did you try?
How is it not working?
It would help if you could be a little more specific 
okay. i have used only a onchange event handler like this when a option is selected.
<select onchange="test(this.options[this.selectedIndex].value)" style="width:120px">
and a small js function which is mostly worthless.
<script type="text/javascript">
function test(url) {
window.location = url.toString();
}
</script>
And I have a another helping site http://10kya.com
In that site, check the currency changer in top right. I want the same functionality like this currency changer.
On your original site, when you select an option from the dropdown menu, your JS code is redirecting you to a new url (using window.location).
Doesn’t this mean that you are loading a new page?
Yes, I know i am loading new page. If there any solution for this?
If you know the solution with the ajax page load. Please share.
On your new page then, do this:
<select>
<option value="">Australia</option>
<option value="" [B][COLOR="#FF0000"]selected[/COLOR][/B]>United states</option>
<option value="">Singapore</option>
<option value="">India</option>
</select>
Whereby you add the selected attribute to whichever option should be pre-selected.
Unless I’m missing something, it is that simple 
I could do that but problem is this is in a single file “header.php”. I think this can be achieved with jquery ajax. I am weak in js. So, if you know jquery ajax, You can create a code.
Thanks for the replies.
Ah, ok, now I understand.
Sure you can do this with JavaScript.
I’ll use jQuery, because you are including it on the page anyway, but it’s not really necessary.
For this to work, you need to give the select element a unique id (e.g. “mySelect”) and the values of the option elements must be the same format as the url
$(function(){
$("#mySelect > option").each(function() {
if(this.value == window.location.pathname){
this.selected = 'selected';
}
});
});