Return radio button value

Asked

Viewed 312 times

1

Although you have set the field default value to "N" in Mysql, when using radio button in the form, if it is not selected, the record comes as null. How to make the entered record, in which the radio button is not checked, come as "N"?

The table configuration is like this: Modelagem dos dados

And the record, after inserted with the use of radio button is like this: Registro após utlização do formulário

I am using the following encoding:

<label for="b_ant">Base Anterior</label><input name="b_ant" type="radio" value="S" />
<label for="b_grade">Base na Grade</label><input name="b_grade" type="radio" value="S" />
  • 1

    On Insert, put it like this: IFNULL(b_ant,DEFAULT(b_ant)

  • Thanks for the reply Francisco. I must put this via PHP or direct in the form?

No answers

Browser other questions tagged

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