Number v 1.0
Converts an input field into a rich featured numbers-only field
If you define decimals = 2:
- type '123' => converts it to '123.00'
- type '123.456' => converts it to '123.47'
- type '123,000' => converts it to '123.00'
- Hold down the shift key to multiple steps by 10
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
step | 1 | integer | defines the steps used on a mousewheel action | 1.0 | only for mousewheel |
decimals | 0 | integer | number of decmials that are displayed | 1.0 | |
start | 0 | integer | defines the starting value on a mousewheel action | 1.0 | only for mousewheel |
min | null | number | define a minimum | 1.0 | |
max | null | number | define a maximum | 1.0 | |
mousewheel | true | true | false | use mousewheel feature | 1.0 | |
onChange | function(){} | function(value) | callback if the value has changed. value is the current value | 1.0 | |
onError | function(){} | function(value) | callback if no valid value (no number) is entered. value is the current value | 1.0 |
Methods
Usage
$(selector).wl_Number([options]);
Markup
<input type="number" class="integer"> //for integers <input type="number" class="decimal"> //for decimals
Example
Date v 1.0
Converts an input field into a rich featured date field. Uses the jQuery datepicker
- use mousewheel to scroll thru dates
- hold down shift to scroll thru month
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
mousewheel | true | true | false | use mousewheel feature | 1.0 | |
value | null | 'now', 'today', 'yesterday', 'tomorrow' | +n | -n | sets the value for the element. 'now', 'today' gets converted in the current date, 'yesterday' and 'tomorrow' adds or substract a day and +n|-n is for an offset time in days (e.g. value= -30 displayes the date one month ago) | 1.0 | don't use the normal 'value' attribute for this placeholders, use data-value instead! |
Check out the jQuery datepicker options for the other options
Methods
Check out the jQuery datepicker methods
Usage
$(selector).wl_Date([options]);
Markup
<input type="text" class="date"> <div class="date"></div> //for inline datefield
Example
Time v 1.1
Converts an input field into a rich featured time field.
You can type a valid time (e.g. 10:30) or following:
- type '1' => converts it to 01:00
- type '12' => converts it to 12:00
- type '123' => converts it to 12:30
- type '1234' => converts it to 12:34
If you use 12h timeformat 23:00 gets converted to 11:00pm
- use mousewheel to scroll thru minutes
- Hold down the shift key to scroll thru hours
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
step | 5 | integer | defines the steps used on a mousewheel action | 1.0 | only for mousewheel |
timeformat | 24 | 12 | 24 | defines the used timeformat | 1.0 | The form will always submit a 24h timeformat |
value | null | 'now' | +n | -n | sets the value for the element. 'now' gets converted in the current time +n|-n is for an offset time in minutes (e.g. value= -60 displayes the time one hour ago) | 1.0 | don't use the normal 'value' attribute for this placeholders, use data-value instead! |
roundtime | true | true | false | round the time to the next "nice" step (e.g. 00:08 => 00:15 => 00:30) | 1.0 | only for mousewheel |
connect | null | id of a datefield | connects the time to a datefield | 1.0 | effects the date field when reaching a new date |
mousewheel | true | true | false | use mousewheel feature | 1.0 | |
onDateChange | function(){} | function(offset) | callback if the date has changed. offset can be +1 or -1 | 1.0 | only for mousewheel |
onHourChange | function(){} | function(offset) | callback if the hour has changed. offset can be +1 or -1 | 1.0 | only for mousewheel |
onChange | function(){} | function(value) | callback if the value has changed. value is the current value (format hh:mm) | 1.0 | |
onError | function(){} | function(value) | callback if no valid value is entered. value is the current value | 1.0 | the field gets the value of '00:00' |
Methods
Usage
$(selector).wl_Time([options]);
Markup
<input type="text" class="time">
Example
Multiselect v 1.3
Converts an multi select dropdown field into a Combo box
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
height | 200 | integer | defines the height of the field in pixel | 1.0 | |
items | [] | Array with item objects | defines additional items to add for the list.
[{ name:'Item Name', value:'item_value' },{ name:'Item Name 2', value:'item_value_2' }] | 1.0 | Elements will get append to the native options |
selected | [] | String | Array | defines values which are selected on initialisation. More values must be defined in an array
['item_value','item_value_2'] | 1.0 | Doesn't affect the native selected options |
showUsed | false | true | false | remove used elements from the list (hide them). Used elements get a 'used' class in any case | 1.0 | |
searchfield | true | true | false | adds a searchfield to the option pool which search for values and names | 1.3 | |
onAdd | function(){} | function(values) | callback if an item is added to the list. values is an array with added values | 1.0 | |
onRemove | function(){} | function(values) | callback if an item is remove from the list. values is an array with removed values | 1.0 | |
onSelect | function(){} | function(values) | callback if an item get selected. values is an array with the selected values | 1.0 | |
onUnselect | function(){} | function(values) | callback if an item get unselected. values is an array with the unselected values | 1.0 | |
onSort | function(){} | function(values) | callback if the list gets sorted. values is an array with all values in the new order | 1.0 |
Methods
option | default | possible values | description | since | info |
---|---|---|---|---|---|
add | function(values,select=false){} | String|Array|Object, true | false | add items to the list. values can be a String (one item name=value), an Array (multiple items, name=value) and an object with different name and value pairs. If select is true item wil get selected too | 1.0 | |
remove | function(values){} | String|Array | remove the item with the specific value from the list. values can be a String or an Array | 1.0 | |
select | function(values){} | String|Array | select values. values can be a String or an Array | 1.0 | |
unselect | function(values){} | String|Array | unselect values. values can be a String or an Array | 1.0 | |
clear | function(){} | clears the selection | 1.0 |
Usage
$(selector).wl_Multiselect([options]);
Calling Methods
Add Elements
$(selector).wl_Multiselect('add','Entry'); // value is equal name $(selector).wl_Multiselect('add',['First Entry','Second Entry']); // value is equal name $(selector).wl_Multiselect('add',{'first': 'First Entry','second': 'Second Entry'});
Select/Unselect Elements
$(selector).wl_Multiselect('[un]select','Entry'); $(selector).wl_Multiselect('[un]select',['First Entry','Second Entry']);
Remove Elements
$(selector).wl_Multiselect('remove','Entry'); $(selector).wl_Multiselect('remove',['First Entry','Second Entry']);
Markup
<select multiple> <option value="artichoke">Artichoke</option> <option value="beans" selected>Beans</option> <option value="broccoli">Broccoli</option> ... </select>
Example
Autocomplete v 1.0
Converts an input field into an autocomplete field using jQuery autocomplete
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
source | null | array, function | defines the source. function must return an array | 1.0 | This field is required! |
Check out jQuery autocomplete for all options |
Methods
option | default | possible values | description | since | info |
---|---|---|---|---|---|
Check out jQuery autocomplete for all methods |
Usage
$(selector).wl_Autocomplete([options]);
Markup
<input type="text" class="autocomplete"> <input type="text" class="autocomplete" data-source="[abc,def,ghi,jkl,mno,pqr,stu,vwx,yz]"> <input type="text" class="autocomplete" data-source="myAutocompleteFunction">
Example
Valid v 1.0
Converts an input field ready for valid inputs
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
errorClass | 'error' | string | the CSS class for an error field | 1.0 | |
instant | true | true | false | instant validation during typing. If false validation will triggert on blur | 1.0 | |
regex | /.*/ | regular Expression | The used regular expression for validation | 1.0 | |
minLength | 0 | integer | minimum length before validation | 1.0 | |
onChange | function(){} | function(value) | callback if the value has changed. value is the current value | 1.0 | |
onError | function(){} | function(value) | callback if no valid value is entered. value is the current value | 1.0 |
Methods
Usage
$(selector).wl_Valid([options]); $(selector).wl_Mail([options]); //shorthand for emails $(selector).wl_URL([options]); //shorthand for urls
Markup
<input type="text" data-regex="[regex]"> <input type="email"> //for emails <input type="url"> //for urls;
Example
Password v 1.0
Converts an input field into a rich featured password field with strengthmeter and confirmation.
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
confirm | true | true | false | Shows a confirmation field | 1.0 | |
showStrength | true | true | false | Shows the strength of the password | 1.0 | |
words | ['too short','bad','medium','good','very good','excellent'] | Array | Words used in the strenght field. First is used if password is to short | 1.0 | |
minLength | 3 | integer | Defines the minimum length of a valid password. Use 0 to disable | 1.0 | |
text | [texts] | object | an object with all required texts | 1.0 |
Methods
Usage
$(selector).wl_Password([options]);
Markup
<input type="password">
Example
Color v 1.0
Converts an input field into a colorpicker using jQuery miniColors
- use mousewheel to scroll thru brightness
- hold down shift to scroll thru saturation
- hold down shift+alt to scroll thru hue
Options read more about inline data attributes
option | default | possible values | description | since | info |
---|---|---|---|---|---|
mousewheel | true | true | false | use mousewheel feature | 1.0 | |
onChange | function(){} | function(hsb, rgb) | callback if the value has changed. hsb is an object and rgb is the color in hex value with leading '#' | 1.0 |
Methods
Usage
$(selector).wl_Color([options]);
Markup
<input type="text" class="color">