Someone
Someone

Reputation: 10575

How to make the Textbox field accept only Decimal Values in jquery

How to make the Textbox field accept only Decimal Values

Upvotes: 1

Views: 2678

Answers (2)

Jet
Jet

Reputation: 1325

Try this:

        function is_int(test) 
            typeof (a = (typeof test == "function" ? test() : test)) == "number" ? !(a % 1) : false;



returns:

is_int(8) // true

is_int("8") // false

function test() {   
        return 12
}

is_int(test()) // true

Upvotes: 0

heisenberg
heisenberg

Reputation: 9759

Can use... http://www.texotela.co.uk/code/jquery/numeric/

Upvotes: 2

Related Questions