Creates styleable elements that function like standard form elements complete with keyboard navigation and selection.
There are a couple of different classes to replace forms.
Form.Check will create an individual checkbox replacement. It wraps the passed in input[type=checkbox] in a div.check (it also copies class names). So:
<input type="checkbox" class="mycheck" name="mycheckName" id="mycheckId" value="mycheckValue" />
becomes
<div class="check mycheck" id="mycheckIdCheck"> <input type="checkbox" class="mycheck" name="mycheckName" id="myCheckId" value="mycheckValue" /> </div>
Form.CheckGroup does Form.Check creation for each input[type=checkbox] inside the element passed to the Form.CheckGroup constructor.
Form.Radio behaves exactly like Form.Check except that the class it adds is radio. So:
<input type="radio" class="mycheck" name="mycheckName" id="mycheckId" value="mycheckValue" />
becomes
<div class="radio mycheck" id="mycheckIdCheck"> <input type="radio" class="mycheck" name="mycheckName" id="myCheckId" value="mycheckValue" /> </div>
Form.RadioGroup behaves like Form.CheckGroup except it creates Form.Radio instances rather than Form.Check instances.
Form.Dropdown replaces a <select> input with a series of nested elements which can be used to simulate the functionality of the <select>. So:
<select name="myselect" id="myselectId" class="myselectClass"> <option>1</option> <option>2</option> <option>3</option> </select>
becomes
<div class="myselectClass select" id="myselectIdDropdown"> <div class="menu"> <div class="list"> <ul class="options"> <li class="option">1</li> <li class="option ">2</li> <li class="option ">3</li> </ul> </div> </div> <div class="selection"> <div class="dropdownBackground"></div> <span class="selectionDisplay">1</span> <input type="text" id="myselectId" name="myselect"> </div> </div>
Form.SelectOption is used by Form.Dropdown but should not be used alone.
For more detailed information about the classes see the documentation
The classes in this project started in mootools-plugins but in order to get them submitted to the forge they needed to be broken up more logically.
This repository breaks out just the Classes that represent styleable form elements.
Build via Packager, requires MooTools Core to be registered to Packager already.
./packager register /path/to/form-replacements ./packager build Form-Replacements/* > form-replacements.js
To build this plugin without external dependencies use
./packager build Form-Replacements/* +use-only Form-Replacements > form-replacements.js
See the documentation
A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.
Found a bug in this plugin? Please report it this repository's Github Issues.
blog comments powered by Disqus