From the course: MERN Essential Training

Unlock the full course today

Join today to access over 23,500 courses taught by industry experts.

Finalize the form

Finalize the form

“

- [Instructor] Now let's finalize the code for the form by adding all the proper functions required and testing the application. Again, as I noted, I've only added a few elements fields for our players, but only to make sure you're not going to see me doing all these elements on screen, which are repetitive. Feel free to add them yourselves on your application. Okay, so let's continue working on our form here. And what I'm going to start adding is the actual submit player function here. So let's go ahead and do this. So I'm going to add a function. Whenever there's an event, first of all, we're going to preventDefault(). And then what I'm going to do is use axios to post to our front end. So again, if you're doing this in the cloud, if you're sending your backend into the cloud, you want to make sure that the URL that you're using here is the proper URL. In this case, I'm using my local install. So I'm going to do localhost:4000. And again, remember the endpoint, we're using players…

Contents