This content originally appeared on DEV Community and was authored by Manu Martinez
Hello friends! Today we are going to talk about forms, yes! because data is also collected through the web, but this is not the only way, and we will see it in another post...
A web form basically works and looks similar to a form like the one made by telephone companies, or any other, which spend hours and hours calling to offer you their services. 😒😓
The web form is composed of one or more control elements (sometimes called widgets), plus some additional elements that help to structure the overall form; they can be single or multi-line text fields, drop-down boxes, buttons, checkboxes or radio buttons, and they are mainly created with the element.
How do we create a form? Pay attention, don't get lost!
- We create the form with the tag.
<form>
......
</form>
- We add the "control" elements.
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname"><br>
- A button to "validate" (submit)
<input type="submit" value="Submit">
- and that's it! The form is ready.
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname"><br>
<input type="submit" value="Submit">
</form>
A validation button is nothing more than a form element that allows data to be sent to the server for processing.
There are many more elements, and attributes to create more complete and complex forms but I'll reserve that for the PDF I'm making for you plus a cheatsheet!
Thanks for reading the post, that's all for today! and remember to always be the best version of you! 🤩
This content originally appeared on DEV Community and was authored by Manu Martinez
Manu Martinez | Sciencx (2022-01-05T10:22:47+00:00) HTML→ The riddles of the sphinx. Retrieved from https://www.scien.cx/2022/01/05/html%e2%86%92-the-riddles-of-the-sphinx/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.