0
I’m trying to get that by clicking on button
btnEditar
release the inputs
: funcionário
, rca
and regiao
... I used this script but it didn’t work:
<script language='JavaScript'>
$('document').on('click','#btnEditar', function(){ $(input[name="funcionario"]).removeAttr('readyonly'); $(input[name="rca"]).removeAttr('readyonly'); $(input[name="regiao"]).removeAttr('readyonly'); });
</script>
These are the inputs and the button
:
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>Funcionário</label></center>
<input type='text' name='funcionario' class='form-control' id='exampleInputPassword1' value=".$row['funcionario']." style='text-align: center;' readonly='readonly' >
</div>
</div>
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>RCA</label></center>
<input type='text' name='rca' class='form-control' id='exampleInputPassword1' value=".$row['rca']." style='text-align: center;' readonly='readonly' >
</div>
</div
<div class='form-group'>
<div class='col-xs-12'><center>
<label for='exampleInputPassword1'>Região</label></center>
<input type='text' name='regiao' class='form-control' id='exampleInputPassword1' value=".$row['regiao']." style='text-align: center;' readonly='readonly' >
</div>
</div
<div class='form-group'>
<div class='col-xs-6'>
<button type='button' class='btn btn-default btn-lg btn-block' role='button' id='btnEditar'><span class='glyphicon glyphicon-pencil'></span> Editar</button>
</div>
</div>
I click and do nothing. This form is in a modal, if that information is important.
Check out: https://stackoverflow.com/questions/5891734/setting-a-control-to-readonly-using-jquery-1-6-prop
– NIZZOLA
@Gabriel so I did the way you said, it may have been solved some error, but even so, still does not do anything when I click the button
– Ferb
if Voce makes an Alert('example') inside the click it is fired?
– Gabriel Rodrigues
No, you want to see the full code?
– Ferb
@Gabrielrodrigues posted the whole code in the answer
– Ferb