From the course: JavaScript for Web Designers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Changing submission with events - JavaScript Tutorial
From the course: JavaScript for Web Designers
Changing submission with events
- To create interactivity, we act on events. It's time to start looking at events how we listen for them, and subsequently take action. When a user interacts with something on a page, one or more events are fired. Clicking a button will trigger a click event, and an input event. Making a selection on a select box will fire an event called change and also an input event. Some events fire without obvious user interaction, like when a video is playing you'll get an event called time update that says how much time has elapsed in the playback of that video. Basically, there are lots and lots of events available in the browser. When we submit this form by clicking this estimate total button, the page reloads with some URL parameters added on here. We don't want to do that. We want JavaScript to take over control of this form, which means we need to listen to an event on that form. Specifically, the submit event. Let's…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Working with user info4m 44s
-
Text fields and select boxes5m 45s
-
(Locked)
Radio buttons and checkboxes5m 30s
-
(Locked)
Changing submission with events4m 21s
-
(Locked)
Starting to validate input4m 15s
-
(Locked)
Disabling and enabling fields5m 14s
-
(Locked)
The basics of sanitizing user input7m 1s
-
(Locked)
Get and set with innerHTML6m 58s
-
(Locked)
Challenge: Add and use more fields56s
-
(Locked)
Solution: Add and use more fields3m 23s
-
(Locked)
-
-
-
-