• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Matt Doyle | Elated Communications

Web and WordPress Development

  • About Me
  • Blog
    • Design & Multimedia
      • Photoshop
      • Paint Shop Pro
      • Video & Audio
    • Online Marketing
      • E-Commerce
      • Social Media
    • Running a Website
      • WordPress
      • Apache
      • UNIX and Linux
      • Using FTP
    • Web Development
      • HTML
      • CSS
      • JavaScript
      • PHP
      • Perl and CGI Scripting
  • Portfolio
  • Contact Me
  • Hire Me
Home / Blog / Web Development / HTML / HTML Forms

HTML Forms

Learn how to create interactive forms in your Web pages with the ‘form’ element.

Banish JavaScript in Web Forms with HTML5

3 September 2010 / 4 Comments

Banish JavaScript in Web Forms with HTML5

View Demo »

Download Code

For years now, most Web forms have included at least some lines of JavaScript code. Typically this JavaScript is used to validate the form — that is, check all the fields have been filled in correctly before the form is sent to the server. JavaScript is also used to enhance forms with additional functionality, such as calendar widgets and the like.

While using JavaScript for these purposes is a pretty good solution, it’s not without its problems:

  • Not all browsers have JavaScript enabled, or can even run JavaScript.
  • Each Web developer builds their JavaScript form validation and widgets differently. This means that, when confronted with a new form, a user has to learn the form’s unique quirks and foibles in order to use it.
  • Adding decent validation to a form — not to mention creating custom widgets for things like dates and number ranges — is both fiddly and time-consuming.

The good news is that these dark days of JavaScript-laden Web forms may soon be coming to an end. Thanks to the joys of HTML5, we can now create forms with built-in validation and rich widgets for dates, numbers and so on, all without including a single line of JavaScript code. Hallelujah!

As with most cutting-edge Web stuff, there’s a catch to all this, and that is browser support (or lack of it). Fortunately, there are a few JavaScript libraries out there that can emulate HTML5 form validation and widgets, as we’ll see later in the tutorial. Sure, this does mean we’re not exactly banishing JavaScript for now, but at least we can remove it once the browsers catch up!

In this tutorial I’m going to walk you through the process of creating a nice, self-validating, widget-rich, HTML5 Web form. It’s an online order form for an imaginary software company.

You can play with the form now by trying out the demo. Fill in a couple of fields, then click “Place Your Order” to see the validation kick in. Try clicking the “Expiry date” field and see what happens.

Ready to code it? Let’s get started!

[Read more…] about Banish JavaScript in Web Forms with HTML5

Creating Accessible Forms

22 November 2006 / Leave a Comment

In HTML forms we looked at the basics of creating HTML forms: GET vs POST, text fields, checkboxes, radio buttons and so on. In this tutorial we’re going to go a step further and look at some of the ways you can make forms more accessible and usable for your visitors.

Web accessibility is important because it makes it easier for users to visit and use your site. This means happier visitors and more traffic!

We’ll cover the following topics:

  • Using the fieldset and legend elements to group form fields in a logical way
  • Adding labels to form fields with the label element
  • Controlling the tabbing order of the elements in a form
  • Speeding up form access and improving accessibility through the use of access keys

By the end of this tutorial you’ll be well on your way to designing wonderfully accessible forms. Read on…

[Read more…] about Creating Accessible Forms

HTML Form Buttons

29 November 2001 / 3 Comments

As well as fields such as text fields, checkboxes and select menus, an HTML form can contain different types of buttons. Form buttons allow the user to submit the filled-in form to the server for processing. Your form will generally contain at least one form submit button so that the form can be sent.

[Read more…] about HTML Form Buttons

HTML Forms – Hidden, Password and File Upload Fields

27 November 2001 / 3 Comments

This tutorial explores three special types of HTML form input fields:

  • hidden fields, for passing information without displaying it to the visitor
  • password fields that allow the visitor to enter sensitive information, and
  • file upload fields that allow visitors to upload files from their hard disk to your Web server.

[Read more…] about HTML Forms – Hidden, Password and File Upload Fields

HTML Checkboxes, Radio Buttons and Select Form Fields

13 November 2001 / 1 Comment

This tutorial takes a look at three HTML form fields that allow your visitors to choose from a list of options: checkboxes, radio buttons, and select menus.

[Read more…] about HTML Checkboxes, Radio Buttons and Select Form Fields

HTML Text and Textarea Form Fields

6 November 2001 / 3 Comments

In this tutorial you explore two HTML form fields that allow visitors to enter text: text fields, suitable for short, single-line text, and textarea fields, which are suited to longer paragraphs of text.

[Read more…] about HTML Text and Textarea Form Fields

HTML Forms

1 November 2001 / Leave a Comment

This series of tutorials shows how to create HTML forms in your Web pages. Forms allow you to make your site interactive — your visitors can use the forms on your site for giving you feedback via email, navigating your site, posting messages and other content to your site, voting and polling, and almost anything else you can dream of!

In this tutorial, you start by looking at the HTML form element, the basic building block of Web forms. You then learn how to use disabled and read-only controls to enhance your forms. Finally, you’ll look briefly at ways to process the results of your forms after they’ve been submitted.

The remaining tutorials in the series look at 8 different types of form fields that you can place in an HTML form, including text fields, checkboxes, radio buttons, menus, text areas, hidden fields, password fields and file upload fields. You’ll also learn how to create submit, image and reset buttons, and how to create generic form buttons. Buttons are needed to “activate” your Web form — for example, to enable the user to send the form after they’ve filled it in.

[Read more…] about HTML Forms

Primary Sidebar

Hire Matt!

Matt Doyle headshot

Need a little help with your website? I have over 20 years of web development experience under my belt. Let’s chat!

Matt Doyle - Codeable Expert Certificate

Hire Me Today

Call Me: +61 2 8006 0622

Stay in Touch!

Subscribe to get a quick email whenever I add new articles, free goodies, or special offers. I won’t spam you.

Subscribe

Recent Posts

  • Make a Rotatable 3D Product Boxshot with Three.js
  • Speed Up Your WordPress Website: 11 Simple Steps to a Faster Site
  • Reboot!
  • Wordfence Tutorial: How to Keep Your WordPress Site Safe from Hackers
  • How to Make Awesome-Looking Images for Your Website

Footer

Contact Matt

  • Email Me
  • Call Me: +61 2 8006 0622

Follow Matt

  • E-mail
  • Facebook
  • GitHub
  • LinkedIn
  • Twitter

Copyright © 1996-2023 Elated Communications. All rights reserved.
Affiliate Disclaimer | Privacy Policy | Terms of Use | Service T&C | Credits