0
Setting: I have a table where the employee can view the data that the company has of it. I need an option for the employee to report divergences in their registration data. Clicking on the button will open a screen containing all data (initially blocked), and the employee will select a data (via a checkbox), the field will be enabled to enter data.
I’m doubting how to draw up this table.
I have it working, but I am using a function for each field, however I have many fields, and I wonder if there is a way to do, that does not need to use so many fields in the script.
Follow 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;
};
Can be with jquery?
– chambelix
@chambelix can yes
– Randrade
I did not understand what was the solution that solved the question. Can you clarify me?
– chambelix