© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
M. SimonJavaScript for Web Developershttps://doi.org/10.1007/978-1-4842-9774-2_5

5. Working with Forms

Mark Simon1  
(1)
Ivanhoe, VIC, Australia
 

HTML forms are an important part of interacting with the user. Typically, the user enters data into the form, and it is then sent to the web server for further processing.

JavaScript can also process form data within the browser. Sometimes, this is to allow it to preprocess or check the data before it is sent to the server, but sometimes it all stays within the browser and doesn’t need to be sent off.

Traditionally, JavaScript has been used for data validation: checking whether the form has been filled in properly ...

Get JavaScript for Web Developers: Understanding the Basics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.