HTML Form Tag
HTML Form Tag
Form Elements
No One Likes Forms
“I’m bored, so I think I will go No one enjoys making forms, or filling them
out, for that matter. However they remain
fill out some forms.” one of the main pieces of interactivity on the
– Said no one, ever web. Poorly designed forms can lead to very
frustrated users.
Starting a Form
Forms are one of the most important
ways users interact with content on the
web. We will look at the various important
form elements and discuss how they
work.
Secondly, they need the cols and rows attribute, which is a bit unusual. This can be
overridden by setting a width and height in CSS, but these two attributes are
considered required.
Of course the ID is needed and name attributes so that the label works and the
data can be retrieved.
The Submit Input Type
The final piece we will look at now is the submit button. It uses the same <input>
element we use for text and other types of input. The name attribute can be
important because we may need it when we process the form.
The value is the the text that shows up inside the button. You can add class, id and
other attributes to the submit type as well.
If you want to use an image as a submit button, you will use <input type="image">
instead.
Form Styling
You can spend A LOT of time styling forms.
Even a simple form can take a while to get
right. Here are a few basic styles for this one.
HTML Form Validation
Some basic form validation has been making
its way into HTML. You can do some basic
front end validation this way, but not all
browsers support it to the same extent.