Use the following code to create a basic inputEx IntegerField.
var field = new Y.inputEx.IntegerField({parentEl: 'container1', showMsg: true}); field.on('updated', function(value) { Y.one('#valueContainer1').innerHTML = "value: "+value+", type: "+typeof(value); });
Test IntegerField with more options.
var field = new Y.inputEx.IntegerField({parentEl: 'container2', showMsg: true, required:true, typeInvite:"Enter a number", trim: true}); field.on('updated', function(value) { Y.one('#valueContainer2').innerHTML = "value: "+value+", type: "+typeof(value); });
Set the negative attribute to true if you allow negative values.
new Y.inputEx.IntegerField({parentEl: 'container3', showMsg: true, required:true, negative:true});
Check values are within a range
new Y.inputEx.IntegerField({parentEl: 'container4', showMsg: true, min:3, max:10, typeInvite:"Integers between 3 and 10 only", size:30});