TextBox Numeric Validation:
txtbx.ClientSideEvents.KeyPress = @"function(s, e) { var str=" + txtbx.ClientInstanceName + ".GetText();" +
"if ((str.indexOf('.') != -1 && e.htmlEvent.keyCode==46) || (str.indexOf('.') != str.length - 3)){return _aspxPreventEvent(e.htmlEvent);}else{" +
"if(e.htmlEvent.keyCode >= 48 && e.htmlEvent.keyCode <= 57 || e.htmlEvent.keyCode==46 ) {return true;}" +
"else {return _aspxPreventEvent(e.htmlEvent);}}}";
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment