General cross-platform form validator