inputEx - IntegerField Usage

Basic IntegerField creation

Use the following code to create a basic inputEx IntegerField.

1var field = new inputEx.IntegerField({parentEl: 'container1', showMsg: true}); 
2field.updatedEvt.subscribe(function(e, params) { 
3    YAHOO.util.Dom.get('valueContainer1').innerHTML = "value: "+params[0]+", type: "+typeof(params[0]); 
4}); 
view plain | print | ?

IntegerField with options

Test IntegerField with more options.

1var field = new inputEx.IntegerField({parentEl: 'container2', showMsg: true, required:true, typeInvite:"Enter a number", trim: true}); 
2field.updatedEvt.subscribe(function(e, params) { 
3    YAHOO.util.Dom.get('valueContainer2').innerHTML = "value: "+params[0]+", type: "+typeof(params[0]); 
4}); 
view plain | print | ?

Negative values

Set the negative attribute to true if you allow negative values.

1new inputEx.IntegerField({parentEl: 'container3', showMsg: true, required:true, negative:true}); 
view plain | print | ?

Min & Max

Check values are within a range

1new inputEx.IntegerField({parentEl: 'container4', showMsg: true, min:3, max:10, typeInvite:"Integers between 3 and 10 only", size:30}); 
view plain | print | ?