views:

48

answers:

2

i need to control the numbers of characters in an input field using jquery ... ive got some control already but, i dont know what else to do ....

var foo = function(){
    if($('#foo1').val() == ''){
     $('.foo_foo_c').load('../html/message_error_number.html');
    }else{
     $('.foo_foo_c').load('../html/foo_foo.html',function(){
      listaStyle();
      listaPagadasStyle();
      listaDetalleLlamadasStyle();
     });
    }


};
A: 

I think you want something like the Alphanumeric plugin.

eKek0
+1  A: 

Look at using the jQuery validation plugin and set up maxLength or rangeLength rule in addition to requiring that it be a number.

tvanfosson