please help me with this problem I want that when I select checkbox
the input
is activated, I want to do it with readonly
because with disabled
it does not save me in BD
, with disabled
if it works but with readonly
no.
function comprobar(obj)
{
if (obj.checked)
document.getElementById('boton').readOnly = false;
else
document.getElementById('boton').readOnly = true;
}
<input name="chec" type="checkbox" id="chec" onChange="comprobar(this);"/>
<label for="chec">Activar</label>
<input name="text" id="boton" readonly />