Forms are ubiquitous on the web. Any time you provide a username and password to log into a site, add a comment to a blog, or order anything online, you are filling out a form. Before we start, there are two important areas that you need to understand will be unaddressed at this time:
- We will not have the opportunity to cover the processing of form data, i.e. what happens after the user clicks the “Submit” button. HTML allows you to create a form, but does not process it: inserting user data into a database or sending the information in a formatted eMail are the role of JavaScript, PHP, Perl, or an alternative. Processing of form data is covered in later articles.
- The form we create will work just fine (up until the moment the user presses submit), but will look terrible. We use CSS to control the appearance of forms, which is again covered in a later article.
Learners are often tempted to add more markup to their forms to make them “look better”. I know it is frustrating to create a form that doesn’t look the way you want it to, but please don’t add markup other than what you learn here. You’ll only be adding redundant or irrelevant tags that will get in the way when we add CSS to forms.
Enjoy this piece? I invite you to follow me at twitter.com/dudleystorey to learn more.