I found the below code to enable and disable textbox based on the option button but i want to more than 20 fields like that.
I want to write lot of scripts for that, is there easy way to create 20 fields like that
Please any one help me regarding this
$(window).load(function() {
$(function() {
window.invalidate_input = function() {
if ($('input[name=opt13]:checked').val() == "Yes")
$('#others').removeAttr('disabled');
else
$('#others').attr('disabled', 'disabled');
};
$("input[name=opt13]").change(invalidate_input);
invalidate_input();
});
}); //]]>
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.0.js"></script>
<label>Did you study any school</label>  
<input type='radio' name='opt13' value='Yes' id="" />Yes
<input type='radio' name='opt13' value='No' id="" />Others</td>
<br />
<br />
<label>Enter MatexBranch:</label>
<input type="textbox" name="others" id="others" />