Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 911 Bytes

README.markdown

File metadata and controls

53 lines (35 loc) · 911 Bytes

minform 2.0 - A Minimalist JavaScript Form Enhancer

Demo at http://www.minjs.com/#minform

Features

  • minimal markup: HTML5 form attributes
  • minimal code: and no library dependencies
  • minimal UI: subtle hints rather than explicit instructions

How to Use

var form = document.getElementById('yourForm');
minform(form);

Features

placeholders

<input placeholder="some text">

You need to style "placeheld" inputs yourself. A good default is:

.placeheld {
  color: #A0A0A0;
  font-style: italic;
}

autofocus

<input autofocus>

Automatically focuses the element when minform() is called on it. Note that only the first autofocus input is focused.

required

<input required>

Will block form submission and focus the required element if it has not been filled in.

Unsupported Browsers

  • Internet Explorer <= 8