Hola
Phoncadiz
Creo que esto te servirá:
Código PHP:
<html>
<head>
<script>
function pulsar(e,txt) {
tecla = (document.all) ? e.keyCode :e.which;
if (tecla==8) return true;
if (txt.length>15) {
alert('Algo');
return false;
}
}
</script>
</head>
<body>
<input type="text" onkeypress="return pulsar(event,this.value)" />
</body>
</html>
Saludos,