You need to custom the 'formatter' and 'parser' functions. Try the code below:
<input class="easyui-numberbox" value="1" data-options="
formatter:function(v){
var s = new String(v||'');
var prefix = '';
for(var i=0; i<4-s.length; i++){
prefix += '0';
}
return prefix+s;
},
parser:function(s){
return parseInt(s)||0;
}
">
I use:
$("#end_number").numberbox({
required:true
formatter:function(v){
var s = new String(v||'');
var prefix = '';
for(var i=0; i<4-s.length; i++){
prefix += '0';
}
return prefix+s;
},
parser:function(s){
return parseInt(s)||0;
}
});
how can only input number(0-9 like 001 or 05 or 0009 or 0000010 ...),
The 0 number is not fixed, thant can start with 0 or 00..?My english is poor, so you maybe know wrong what i mean in to top(for(var i=0; i<4-s.length; i++)).
thanks!