Hi florenz,
You can simply acheive with the help of jquery refer below code and change it according to your need
jQuery
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
if ($('[id*=checkboxID]').is(':checked')) {
$('[id*=textboxID]').attr('disabled', true); // $('[id*=textboxID]').attr('disabled', 'disabled');
}
});
//or if you want to achieve it on some event like below its for button click event
$(function () {
$('[id*=buttonID]').click(function () {
if ($('[id*=checkboxID]').is(':checked')) {
$('[id*=textboxID]').attr('disabled', true); // $('[id*=textboxID]').attr('disabled', 'disabled');
}
else {
$('[id*=textboxID]').attr('disabled', false); // or $('[id*=textboxID]').attr('enabled', enabled);
}
return false;
});
});
</script>