Is there a way to change the color of a text box to grey and make it read-only when a checkbox is ticked? I have managed to make the text box read-only, but I can't figure out how to also turn it grey. Using the disabled attribute won't work in this case because I still need the value of the text box to be sent, so that option is not available.
jQuery(document).ready(function () {
$("#redflag2").click(function () {
$('#new_contracted_support_hours').attr("readonly", $(this).is(":checked"));
$('#new_contracted_support_hours').addclass("greyba", $(this).is(":checked"));
});
});
css
.greyba{
background-color:rgba(178,178,178,1.00);
}