Thursday, January 13, 2011

numeric input validation

Most of the times we need to validate the input box. Using the following java script we can take only numeric value as an input


$(document).ready(function () {

    $(".number").live("keyup", function () {
        this.value = this.value.replace(/[^0-9\.]/g, '');
    });})

we can use the script following ways:

<input  ="" class="number" type="text" />

No comments:

Post a Comment

5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...