- The last thing we need to do is take care of…linking our chart to our form controls.…So that the chart loads new data…when we change the range of dates.…Now we'll do that by tracking some events.…Specifically, a change event on the form elements.…Now there's a couple of ways that you could do this.…You could create an event handler…for each of these form controls.…But since we've given this form a name,…and there's no other form controls in this form…we can just target an event…that looks for anything changing inside the form.…
So right after this loadChart,…we're going to write a section that's…going to handle events for us.…And here we're going to target the document.forms…and then the rangeform, specifically.…Then we're going to add an EventListener.…This EventListener is going to look for a change event.…That's an event that will signal…that one of those fields has been changed.…Now here, we're going to create a function…and traditionally that function…gets passed along an event.…
I don't think we're going to need the event itself.…
Visit other courses in the series to see how to solve the exact same challenges in languages like C++, C#, Java, PHP, Python, R, Ruby, and Swift.
Skill Level Intermediate
1. Problem One - Exploring Lake Pend Oreille
2. Problem Two: Image Analysis
3. Problem Three: Eight Queens
4. Problem Four: Accessing Peripherals
5. Problem 5 - Recursion and Directories
6. Problem 6 - Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.