Gondim
Gondim

Reputation: 3048

InputText with only numbers using jQuery

I've been trying to make a input text to fill up with only numbers, i'm using jQuery to do(try...) this job

<rich:jQuery selector="#code" query="mask('9999999999')"/>

This isn't working.. any idea of what can I do? Can I set max value? for example: max value is 2147483647

Upvotes: 0

Views: 2481

Answers (2)

Renan
Renan

Reputation: 741

jQuery alphanumeric

<rich:jQuery selector="#code" query="numeric()"/>

Upvotes: 0

Jeff Lamb
Jeff Lamb

Reputation: 5865

Have you tried LiveValidation?

LiveValidation.com

var myNumberField = new LiveValidation('myNumberField');
myNumberField.add( Validate.Numericality );

Upvotes: 2

Related Questions