Java Script

Value show & hide with dropdown

<select class="form-control" id="services" name="services" onchange="changeDropdown(this.value);" required>
<option></option>
<option value="Dish">Dish</option>
<option value="Internet">Internet</option>
<option value="Dish + Internet">Dish + Internet</option>
</select>
<select class="form-control" id="speed" name="speed">
<option>Internet Speed</option>
</select>
<script>
function changeDropdown(){
    var state=document.getElementById("services").value;
    if(state=="Dish" || state=="Internet")
    {
        document.getElementById("speed").style.visibility='hidden';
    }
    else {
        document.getElementById("speed").style.visibility='visible';
    }
}
</script>

Leave a Reply

Your email address will not be published.