Validate `<input>` on tab over?

I have seen a bunch of JavaScript validation tutorials which validate your input as you type.


However they all seem to be constantly validating, which could prove annoying to end-users.

Can I make it validate only after you've tabbed to the next <input>,<button> or <a>?

[using pure JS, no JQuery or other library]


Sure. You'd want to use the onblur event on your element.

elem.addEventListener('blur', validateInput, false); // validateInput being your validation function

Need Your Help

Chmod specific directories using Phing FtpDeploy task

wordpress ftp chmod phing

I've recently setup a Phing build step to deploy a Wordpress website to an external FTP server.

Understanding Difference between ToArray and JSON

c# jquery web-services

I'm working on jquery to get data bind it to the dropdownlists &amp; also I used web service method, and its working great but I'm not getting some clarification I,e for binding data to one dropdow...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.