Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

stevepolitodesign/netlify-gatsby-radio-buttons-example

Repository files navigation

Netlify-Gatsby Radio Buttons Example

The repository demonstrates how to use radio buttons on Netlify forms built in Gatsby.

Deploy to Netlify

Problem

If you don't wrap the input in a label, the results will save incorrectly as seen below. "Small" should really be "size", since "size" is the name of the input

<input type="radio" name="size" id="small" value="small" required />
<label htmlFor="small">Small</label>

Netlfiy form results that are incorrectly saved

Solution

Wrap the input in a label to ensure the name of the input is used in the results.

<label>
    <input type="radio" name="size" id="small" value="small" required /> Small
</label>

Netlfiy form results that are correctly saved

About

Learn How To Correctly Format Radio Buttons Using Netlify and Gatsby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published