Gracias JavierB
He puesto un par de cosillas a la función como me comentas, aquí la pongo:
Código PHP:
<html>
<head>
<script>
function numeros(e,txt) {
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8) return true; //Tecla de retroceso (para poder borrar)
if ((tecla<48 || tecla>57) && tecla!=46 && tecla!=44 ) return false
if (tecla == 46 && (txt.indexOf('.')!=-1 || txt.indexOf(',')!=-1)) return false;
if (tecla == 44 && (txt.indexOf(',')!=-1 || txt.indexOf('.')!=-1)) return false;
}
</script>
</head>
<body>
<input type="text" onKeyPress="return numeros(event,this.value)">
</body>
</html>
Pero no encuentro una tabla de caracteres que tenga el suprimir y los cursores para añadírselos a la función.
¿Tienes alguna información y completo un poco más la función?
Muchas gracias.