Tuesday, June 10, 2008

Infragistics Web Numeric Edit

In numeric edit if you have to get the text box value and do some client side validation..and set some new values...the event we need to target is the _ValueChange. The in built functions are

getValue() and SetValue()

script id="igClientScript" type="text/javascript"

function wneHour_ValueChange(oEdit, oldValue, oEvent){

var newValue = oEdit.getValue();
var a = true;

if(newValue < 1)
{
oEdit.setValue("1");
a = false;
}
if(newValue > 12)
{
oEdit.setValue("12");
a = false;
}

if(newValue > 0 && newValue < 10)
{
var leadingzero = "0";
var newtext = leadingzero + newValue;
oEdit.setValue(newtext);
}

//Not calling this event will create a postback
oEvent.cancel = true;
}
// -->
/script

2 comments:

Anonymous said...

You write very well.

tamizhppiriyan said...

Thanks for visiting lexine...hope it is helpful