diff --git a/docs/docs/building-a-contact-form.md b/docs/docs/building-a-contact-form.md new file mode 100644 index 0000000000000..20ab8fbe5deac --- /dev/null +++ b/docs/docs/building-a-contact-form.md @@ -0,0 +1,150 @@ +--- +title: Building a Contact Form +--- + +This guide covers how to create a contact form in a Gatsby site, along with an overview of some strategies for handling form data that has been submitted. + +Gatsby is built on top of React. So anything that is possible with a React form is possible in Gatsby. Additional details about how to add forms to gatsby can be found in the [Adding Forms](/docs/adding-forms/) section. + +## Creating an Accessible Form + +Faulty forms are a common barrier to a website's accessibility, and can be especially problematic if you use a keyboard and screen reader to navigate the web. Forms should be clearly and intuitively organized into groups of related information, and each form field should be identified with a proper label. + +More information on creating accessible forms can be found in [WebAIM's article](https://webaim.org/techniques/forms/) on the subject. + +## Sending Form Data + +When you submit a form, the corresponding data is typically sent to a server to be handled in some manner. More in-depth information on sending form data can be found [on MDN](https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data). + +Each method detailed below will start with the following contact form: + +```jsx:title=src/pages/contact.js +
+ + + +