add support for checkbox validation

Wondering if custom validation function in the example should just be moved into the library since it's the only thing that makes sense to do.