Submitting Forms

Learn to implement the submission form.

Submitting the form is the final part of the form’s implementation. We are going to implement form submission logic in all three of our forms, starting with the search form.

Submission logic is logic that performs a task with the data from the form. Often, this task will involve posting the data to a web API to perform a server-side task, such as saving the data to a database table. In this section, our submission logic will simply call functions that will simulate web API calls.

Implementing form submission in the search form

In Header.tsx, carry out the following steps to implement form submission on the search form:

  1. Import the useNavigate hook from React Router:

Get hands-on with 1200+ tech skills courses.