If you wanted to add a gender radio select for example you would first need to add it to the formData state:
formData
const [formData, setFormData] = useState({ name: "", gender: "", email: "", street: "", city: "", postcode: "", comments: "", });
Then in the form step the radio would be rendered like this:
<p> <label htmlFor="name">Male:</label> <input type="radio" name="gender" value="male" checked={data.gender === "male"} onChange={handleChange} /> <label htmlFor="name">Female:</label> <input type="radio" name="gender" value="female" checked={data.gender === "female"} onChange={handleChange} /> </p>
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you wanted to add a gender radio select for example you would first need to add it to the
formData
state:Then in the form step the radio would be rendered like this: