Radio Button does not work

Asked

Viewed 451 times

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" ?

  • Guy don’t know much of php, but if you take the php tag works normally.

  • 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

  • What is returning the $Result_sexoM and $Result_sexoF?

  • Returns the sex of the user

  • That’s understandable, the problem is that without the PHP the script is working, so the problem should be in the content of these variables.

  • 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.

  • quiet vlw by the attempt

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.