Better example

Thanks for this great plugin! Saved me time writing my own.

Your example code does not include error handling, meaning validation has no effect on the outcome. I've included a simple error handling example to get people started.