<script type="text/javascript" src="http://yandex.st/jquery/1.7.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$('input[id^="agree"]').each(function(){
var nextInp = $(this).next().next('input[id^="continue"]');
nextInp.attr('disabled',true);
$(this).change(function() {
if($(this).attr('checked')){nextInp.removeAttr('disabled');
} else nextInp.attr('disabled',true);
//Еще коды...
});
});
});
</script>
<input type="checkbox" name="agree1" value="а1" id="agree1">".$mat["name"].<br>
<input onclick="this.select();" type="text" id="continue1" value="Введите число" /><br>
<input type="checkbox" name="agree2" value="а2" id="agree2">".$mat["name"].<br>
<input onclick="this.select();" type="text" id="continue2" value="Введите число" /><br>
<input type="checkbox" name="agree3" value="а3" id="agree3">".$mat["name"].<br>
<input onclick="this.select();" type="text" id="continue3" value="Введите число" /><br>