1
I created a form and put a radio button disabled and let it be enabled at the click of a button, when the button is pressed it is enabled but I can not change the option, the radio is locked in an option
script to enable radio button
$(document).ready(function() {
$("#EditarDados").click(function (event) {
event.preventDefault();
$("#nome").prop("disabled", false);
$("#sobrenome").prop("disabled", false);
$("#email").prop("disabled", false);
$("#sexo").prop("disabled", false);
$("#sexo2").prop("disabled", false);
$("#telefone").prop("disabled", false);
$("#celular").prop("disabled", false);
$("#senha").prop("disabled", false);
$("#categoriaPerfil").prop("disabled", false);
$("#observa").prop("disabled", false);
$("#formacao").prop("disabled", false);
$("#senha").prop("disabled", false);
});
});
HTML
<p>
<input required name="Cd_sexo" id="sexo" value="Masculino" type="radio" id="rd_masculino" <?php echo $Result_sexoM ?> disabled="disabled"/>
<label for="rd_masculino">Masculino</label>
<input required name="Cd_sexo" id="sexo2" type="radio" value="Feminino" id="rd_feminino" <?php echo $Result_sexoF ?> disabled="disabled"/>
<label for="rd_feminino">Feminino</label>
</p>
Button
<button class="btn blue center-align" name="Editar" id="EditarDados">Editar Dados
</button>
php
<?php
include_once("../ibico/php/usuario_class.php");
$result =usuario::PopulaPerfil();
$Result_sexoM = '';
$Result_sexoF = '';
$result_select= utf8_encode($result['nm_area_atuacao']);
if($result['sx_sexo']=="Masculino")
{
$Result_sexoM ="checked";
}
else
{
$Result_sexoF ="checked";
}
?>
Cade o btn "Editardados" ?
– hugocsl
Guy don’t know much of php, but if you take the php tag works normally.
– LeAndrade
The tag I’m using to take from the bank the sex that was set, and because I enable the edition at the click of the button to change the sex, all the change form I did so, only the radio button that disables and will not
– Reignomo
What is returning the
$Result_sexoM
and$Result_sexoF
?– Dobrychtop
Returns the sex of the user
– Reignomo
That’s understandable, the problem is that without the
PHP
thescript
is working, so the problem should be in the content of these variables.– Dobrychtop
I did not see his 2 variables were initialized, so my answer is invalid, with the codes on the same page I could not reproduce the error.
– Dobrychtop
quiet vlw by the attempt
– Reignomo