Handle focus changes JavaScript and PHP Forms


show more Handling focus changes provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the Validating and Processing Forms with JavaScript and PHP show less
please wait ...

Handling focus changes

Events let our applications know when something has happened on our page. Forms have the ability to trigger special events that can be helpful for processing and validating. In this movie we're going to take a look at the elements selection events called, On Focus and On Blur. So we're going to be working with this form and I've left a little spot here where I want some feedback to happen when somebody enters one of these fields. So let me go into the code and show you that, that additional span is right here. It has an ID of my name hint and class of hint.

So I'm going to go all the way to the bottom of the page, and right before the closing body tag, I'm going to add a script. Now in this script, I want to get to the form element, so I'm going to add document dot the form. Which is the name of the form, and then the field that I want to get to, which is my name. And then add an event handler here. So, I'm going to add the onfocus event, just t...

Handling focus changes
Video duration: 2m 47s 2h 51m Intermediate

Viewers:

Handling focus changes provides you with in-depth training on Developer. Taught by Ray Villalobos as part of the Validating and Processing Forms with JavaScript and PHP

Subjects:
Developer Web
Software:
JavaScript PHP
Author:
please wait ...