Error picking radio input data

Asked

Viewed 65 times

1

Guys, I’m having the following problem sending the form: Mensagem de erro ao enviar o formulário

Follow part of the form code and validation:

    <div class="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>

Validação onde esta ocorrendo o erro na linha 22

*It’s my first time posting on Stack, sorry if I did something wrong.

1 answer

2


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

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

Change the $_POST for $_POST["optradio"] or the names of radios to sexoFunc.

Browser other questions tagged

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