Convert lowercase to uppercase in JavaScript

This tutorial will show you how to convert from lowercase to uppercase using JavaScript onkeyup event. There is an input box where you will type and onkeyup JavaScript event will call a custom function which will convert the lowercase letter to uppercase letter. onkeyup means as you type the function will be called and the letter will be converted instantly to uppercase. Continue reading “Convert lowercase to uppercase in JavaScript”

Allow only numeric values or digits in a TextBox using JavaScript or jQuery

The example, allow only numeric values or digits in a textbox using javascript or jquery, shows how to accept only numbers or digits in a textbox using JavaScript or jQuery. Sometimes we need to accept only numbers for a textbox instead of validation then it comes handy. In this type of validation user will not be able to type a non-numeric values.

This tutorial shows both validation and accepting only numbers in a textbox. This example also shows inline JavaScript function call with the input textbox. We will see each example one by one.

Example – using JavaScript

The javascript function checks for charcode when a key is pressed in the keyboard and it check if it does not fall between 48 and 57 then it is other than digit. So we show the error message to the user.

We call the javascript function onkeypress javascript event. You can also call this function onkeyup javascript function. Continue reading “Allow only numeric values or digits in a TextBox using JavaScript or jQuery”