Implemented javascript validator (but without validator callback checks).