| |||
| input type text solo numerico Hola a todos, quiero hacer un input type text pero que solo admita numeros... He hecho esto: Código PHP: Gracias, |
| ||||
| Respuesta: input type text solo numerico Pon esto entre <head> y </head>: Código HTML: <script type="text/javascript"> <!-- /* Enable only numbers Author: Dano Website: www.danonino.org Licence: ¿? */ function onlyNumbersDano(evt) { var keyPressed = (evt.which) ? evt.which : event.keyCode return !(keyPressed > 31 && (keyPressed < 48 || keyPressed > 57)); } //--> </script>
Código:
onkeypress="return onlyNumbersDano(event)"
__________________ Soluciona en menos de 10 minutos el cubo de Rubik. Web de tutoriales, en la que aprenderás a hacerlos Por tí mismo. |