From the course: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Reading form data with the DOM API
From the course: Learning Full-Stack JavaScript Development: MongoDB, Node, and React
Reading form data with the DOM API
- [Instructor] The next step would be to propose a new name and this is going to be our first update operation, and it has multiple elements to it. The first task would be to create a form so that the user can submit the name, that's straightforward, it's just HTML so I'm going to add it here somewhere. Another title DIV, this time let's label it propose a new name, and in a body DIV, we need a form element, we don't need an action, this action is to submit the form regularly, not with JavaScript and within the form, we need an input text. To identify that input we can use either the name or the ID. I'm going to use the name to show you how to deal with that through the DOM API, let's name it new name and we can also add a placeholder here with a text like new name here. The other thing that we need for the form is a submit button so we'll do a button, submit, with a label, submit. Let's take a look at that form, and…
Contents
-
-
-
-
-
-
-
(Locked)
Handling data in an array3m 27s
-
(Locked)
Reading form data with the DOM API6m 49s
-
(Locked)
Understanding HTTP request methods2m 19s
-
(Locked)
Using an API endpoint to update data9m 48s
-
(Locked)
Updating UI based on API response1m
-
(Locked)
Project challenge2m 1s
-
(Locked)
Next steps1m 27s
-
(Locked)