Skip to content

Latest commit

 

History

History

contact-form

Contact Form

Contact Form

Live

Description

A contact form that validate inputs and submit the data to API endpoint.

Project Setup

  1. Rename .env.sample to .env, and add a valid API endpoint.

  2. Install dependencies:

npm i
  1. Run the development server
npm run serve
  1. Run tests (optional)
npm run test:unit

User Stories

  • Form should have elements for: name, email, subject, message, and a button to submit.
  • Name input should be between 5 and 50 characters, and is required.
  • E-mail input should validate an e-mail address, like: [email protected], and is required.
  • Subject is optional, and has a limit of 100 characters.
  • Message should have the maximum of 500 characters, and is required.
  • User should be able to clearly see which input is invalid, and get a message explaining if when it's invalid.
  • User can send the message after clicking the button to submit.
  • User must see the sending status and the result (error or success).
  • If there's any error, user's input should remain in form fields.

Bonus features

  • Unit tests should be written for the main component.

Useful links and resources