<script>
$('#Select_Font').attr('disabled', 'true');
$('#Enter_Text').attr('disabled', 'true');
$('.dropdownstyle').change(function(){
$(".dropdownstyle option:selected").text();
if($(this).attr('value').match(/Custom$/))
{
$('#Select_Font').attr('disabled', 'false');
$('#Enter_Text').attr('disabled', 'false');
} else if($(this).attr('value').match(/no Thanks$/))
{
$('#Select_Font').attr('disabled', 'true');
$('#Enter_Text').attr('disabled', 'true');
}
});
</script>
<table>
<tbody>
<tr>
<td>
<span>Select type</span>
</td>
<td>
<select class="dropdownstyle">
<option value="No Thanks">No Thanks</option>
<option value="Custom lid (200)">Custom lid (200)</option>
</select>
</td>
</tr>
<tr>
<td>
<span>Select font</span>
</td>
<td>
<select id="Select_Font">
<option value="Arial">Arial</option>
<option value="georgia">georgia</option>
</select>
</td>
</tr>
<tr>
<td>
<span>enter text</span>
</td>
<td>
<input type="text" id="Enter_Text">
</td>
</tr>
</tbody>
</table>
In above code initially I want font drop-down and text-box disable but on select of custom form first drop-down I want font drop-down and text box to be enable. I am not sure where I am going wrong, so what should be done to make it work.