Demo at http://www.minjs.com/#minform
- minimal markup: HTML5 form attributes
- minimal code: and no library dependencies
- minimal UI: subtle hints rather than explicit instructions
var form = document.getElementById('yourForm');
minform(form);
<input placeholder="some text">
You need to style "placeheld" inputs yourself. A good default is:
.placeheld {
color: #A0A0A0;
font-style: italic;
}
<input autofocus>
Automatically focuses the element when minform()
is called on it. Note that only the first autofocus input is focused.
<input required>
Will block form submission and focus the required element if it has not been filled in.
- Internet Explorer <= 8