Conteúdo do Curso
HTML Essentials
HTML Essentials
3. Images and Media
Forms
Forms
Forms are a key tool in collecting user input and submitting it to a server for processing. They are made up of different form elements that allow users to input data. However, in this course, we won't send any data to a server as it requires additional knowledge beyond the scope of this course.
All examples in the code have the attribute onsubmit="return false"
. This attribute prevents the form from sending a request to the server by default.
Creating Forms
The <form>
tag is used to create an interactive form on a web page. It contains various form elements for user input.
Example:
Form Elements
HTML provides various input types to collect user input. Each has specific attributes and behaviors. Also, we can specify the label for each input. Labels are used to associate text with form input elements, providing a more accessible and user-friendly experience. We will discuss labels and inputs in depth in the following chapters.
Example:
Form Submission
Form submission is triggered by a submit button (<button type="submit">
), which can send the form data to the server for processing.
Example:
Here is the basic form example.
index
index
index
Video Tutorial
Tudo estava claro?