How does Twitter create the form validation on it’s signup page?

I’m not creating a signup form, just an enquiries form which I would like to use the Twitter style validation.
Are there any specific tutorials or resources to create something very similar?
Will this kind of validation stop spam to some degree?
Yes, there are several. Here is a page that shows 10 jquery examples and tutorials.