var country = document.getElementById("select-country"); if(country.value && continent.value){ url += country.value+'-'; } var type = document.getElementById("select-type"); if(type.value && country.value ){ url += type.value+'-0.html'; } window.open(url); return false; }