What's the nicest way of doing clientside form validation without annoying the user?

I keep finding forms that show red errors when I write 'wilfred@' for an email or '0' for a telephone number because I haven't finished inputting the value.

@wilfredh Probably with a bit of JavaScript magic and onfocusout.