Error getting data from input radio

1

Well, I'm having the following problem while submitting the form:

Hereispartoftheformcodeandvalidation:

<divclass="form-group">
      <label for="sexoFunc" class="control-label col-sm-2">Sexo:</label>
      <div class="radio-inline">
        <label for="masc">
          <input type="radio" value="M" name="optradio" id="masc">Masculino</label>
      </div>
      <div class="radio-inline">
        <label for="fem">
          <input type="radio" value="F" name="optradio" id="fem">Feminino</label>
      </div>
    </div>

* This is my first time posting on Stack, sorry if I did something wrong.

    
asked by anonymous 24.05.2018 / 15:18

1 answer

2

This error indicates that there is no value in your $_POST variable with the name "sexFunc".

The form indicates that name of radio button is optradio and not sexFunc . The $_POST takes the value by the name of the element sent by the form.

Change the $_POST to $_POST["optradio"] or name s from radio s to sexoFunc .

    
24.05.2018 / 15:26