Showing the Submitted Data in the Form
Learn how to prevent the form from getting empty when the user provides the wrong data.
We'll cover the following...
Populating the form fields with normalized data
Everything works well, except the form isn’t very user-friendly.
As you may have noticed, when something is wrong with the data, the form returns to being empty.
To fix this, we should take the normalized data and use it to populate the form fields, but only if it is defined.
For most input
-type fields, we can set the value
attribute to what was submitted (don’t forget to escape ...
Access this course and 1400+ top-rated courses and projects.