PHP

How to set Gender Male to show the word "Male" when I echo it from radio button?

  • radiobutton
  • php
  • form
  • gender

2 comments

It work! thank you. Suggest that we can mark this post as solved!

I can see that your radio buttons do not have value in them. So by default, it will return "on" or "off".


<input type="radio" name="gender" value="male" id="option1" autocomplete="off"> Male

<input type="radio" name="gender" value="female" id="option1" autocomplete="off"> Male

Given that your other PHP code works, this should do the job.