i am making a calulator. i want when a user input any charater (a-z) it will replace with zero. it it's effect will show on result. and when user enter numeric value then it display with its results. thank's
You can use this: <input type='text' value='' onkeyup="this.value = this.value.replace(/[a-z]/ig, '')"> Code (markup): You must also think about other inacceptable characters like '^', '&', etc.
some JavaScripts you need, can use one of these JavaScripts, or you can use all - JavaScriptBank.com: Block Key Press - JavaScriptBank.com: Validate Numeric Only - JavaScriptBank.com: RegExp Validation ....... I can not list all JavaScripts that you need, please go to my JavaScript library for thousands of free JavaScript