Editor HTML5 'number'-field
Editor HTML5 'number'-field
Just a simple HTML5 number Field.
Plugin Code:
_fieldTypes.number = {
create: function ( conf ) {
var that = this;
conf._input = $(
'<input id="'+conf.id+'" name="'+conf.name+'" type="number" class="form-control">')[0];
return conf._input;
},
get: function ( conf ) {
return $(conf._input).val(); //return the field value POST
},
set: function ( conf, val ) {
$(conf._input).val(val); //set the field value
}
};
After you saved the Plugin Code you can simple use "number" as type.
{
label: 'Number'
name: 'numberfield',
type: 'number'
}
This discussion has been closed.
Replies
Hi,
Another option is to use the
attr
option of thetext
field type to set thetype
property:I didn't set the
fields.type
property as it istext
by default.Allan
.. tzz thank you :) a lot easier!