O'Reilly logo

JavaScript™ Phrasebook: Essential Code and Commands by Christian Wenz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Forms

When you’re working with server-side technologies, forms are the one aspect of HTML that is most useful since it enables users to “communicate” with the server—by entering data into a form and then submitting that form to the server.

From a JavaScript point of view, HTML forms are very interesting as well. The options HTML is offering are somehow limited, and JavaScript can come to the rescue here. User data must be validated, forms may accept only certain kinds of input, form submission can be possible only when certain requirements are met. All this—and more—is possible with JavaScript, as covered in this chapter.

Understanding HTML Forms with JavaScript

Example . 

document.forms[0]

Usually, you access an HTML element using its ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required