Enable and Disable Input Fields on Selecting value from Dropdown

Dropdown Dependant <input> Field using jQuery



<select class="form-control" id='rilmavn' name="cntrilm-for" required="" disabled>
<option value="None">Select</option>
<option value="Asha Kiran">Asha Kiran</option>
<option value="Others">Others</option>
</select>
<script>
$('#rilmavn').change(function() {
if( $(this).val() == 'None') {
$('#cntrilm-ashakirans').prop( "disabled", true );
} else {       
$('#cntrilm-ashakirans').prop( "disabled", false );
}
});
</script>
<input class="form-control" type="text" value="" name="cntrilm-ashakirans" id="cntrilm-ashakirans" placeholder="No. of Asha Kirans/Others" disabled>

Comments

Popular posts from this blog

Domain Name Registration in Agra

Things to know about Popup

WEB DEVELOPMENT COMPANY IN CHANDAUSI