Polyfill for form validation