Polyfill to provide support for the HTML5 "required" attribute on older browsers.
Does not provide a fancy interface like many browsers. Just a simple popup to let the user know the form is not ready. If users want a nicer interface they should use a nicer browser. :)
Just compile and include on page. Then use the "required" attribute as if everybody is running a modern browser. You must place the include at the bottom of the page so the form elements will already be in the DOM.
When compiling the "bare" option should be disabled. This is usually the default but always check. For example the CoffeeScript website's in-browser compiler has "bare" enabled. If "bare" is enabled the script will still work but it will pollute your namespace.
- Is a no-op for browsers that already support the "required" attribute.
- Requires no external libraries (i.e. Prototype, jQuery, etc.)
- Does not use any advanced features (like querySelectAll) for max compatibility.