function validaNumeroDecimal(e){
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8 ){
return true;
}
patron =/[0-9.,]/;
tecla_final = String.fromCharCode(tecla);
return patron.test(tecla_final);
}
//<input type="text" name="" id="" onkeypress="return validaNumeroDecimal(event)">
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.