You can do this:
$("#check1, #check2, #check3").click(function() {
var textId = "#" + this.id.replace("check", "text");
$(textId).attr('disabled',! this.checked)
});
Or
$(":checkbox[id^=check]").click(function() {
var textId = "#" + this.id.replace("check", "text");
$(textId).attr('disabled',! this.checked)
});
...provided that you don't have any checkboxes whose IDs start with "check" that you don't want included in the selector.
Basically, any selector that will identify the checkboxes in question will work, and then it's just a matter of manipulating the ID.
Update: It may be that you can do away with IDs entirely, depending on your HTML structure. For instance, given this form:
<form id='foo'>
<label><input type='checkbox'>Field 1</label>
<br><input type='text' size='40' disabled>
<br><label><input type='checkbox'>Field 2</label>
<br><input type='text' size='40' disabled>
<br><label><input type='checkbox'>Field 3</label>
<br><input type='text' size='40' disabled>
<br><label><input type='checkbox'>Field 4</label>
<br><input type='text' size='40' disabled>
</form>
...we can achieve the desired effect like this:
$("#foo input[type=checkbox]").click(function() {
var next = $(this).parent().nextAll('input[type=text]:first');
next.attr("disabled", !this.checked);
});
Live example