Scenario: I have a table where the employee can see the data that the company has of it. I need an option for the employee to report disagreements on their cadastral data. When you click the button, it will open a screen that will contain all data (initially blocked), and the employee select a data (through a checkbox), the field will be enabled for data insertion.
I am doubtful how to draw this table.
I have it working, however I am using a function for each field, however I have many fields, and I would like to know if there is a way to do it, that does not need to use so many fields in the script.
Follow the Fiddle for better understanding. Example here
HTML
<input type="checkbox" id="Cpf">
<input type="text" id="CpfT">
<input type="checkbox" id="RG">
<input type="text" id="RGT">
JS:
document.getElementById('Cpf').onchange = function() {
document.getElementById('CpfT').disabled = !this.checked;
};
document.getElementById('RG').onchange = function() {
document.getElementById('RGT').disabled = !this.checked;
};