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
Subscribe to:
Post Comments (Atom)
2 comments:
You write very well.
Thanks for visiting lexine...hope it is helpful
Post a Comment