Java script for accept only numbers

  function fnCheckIntegerValue(e, o) {
            var vTxtVal = o.value;
            var sTst = false;
            evt = e || window.event;
            var keyPressed = evt.which || evt.keyCode;
            if (keyPressed < 58 && keyPressed > 47) {
                sTst = true;
            }
            else {
                //o.value = vTxtVal;
                //e.returnValue = false;
                sTst = false;
            }
            return sTst;
        }
   
Event in submit button
onkeypress="return fnCheckIntegerValue(event, this);"


Comments

Popular posts from this blog

SQL Query :- Create Tables,Primary key,Foreign key,Merge Statment

AngularJS

Check folder and Delete All Files from Existing Folder in C#