Hola
Yanka_17
Creo que esto te servirá:
Código:
<html>
<head>
<script type="text/javascript">
function pulsar(e) {
tecla = (document.all) ? e.keyCode : e.which;
if (tecla==8) return true;
patron =/\s/;
te = String.fromCharCode(tecla);
return !patron.test(te);
}
</script>
</head>
<body>
<input type="text" onkeypress = "return pulsar(event)" />
</body>
</html>
Saludos,