# inputEx - IntegerField Usage

## Basic IntegerField creation

Use the following code to create a basic inputEx IntegerField.

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

## IntegerField with options

Test IntegerField with more options.

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

## Negative values

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

new inputEx.IntegerField({parentEl: 'container3', showMsg: true, required:true, negative:true});

## Min & Max

Check values are within a range

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