"Carlos Marangon" <ar****@hotmail.com> wrote in message
news:2c*************************@posting.google.co m...
Hello!
People go to sign my guestbook and wrote all text in capital letters.
Did you know any script that shows an window alert when one types the
second capital letter?
Best regards,
Carlos
Perhaps?
<html>
<head>
<title>capitals.htm</title>
<script language="javascript" type="text/javascript">
<!--
function capitals(that) {
var Max = that.value.length;
if (Max < 2) return;
var Cap = 0;
for (var i=0; i<that.value.length; i++) {
var char = that.value.charAt(i);
if (char >= "A" && char <= "Z") {
Cap++;
if (Cap > 1) break;
} else {
Cap = 0;
}
}
if (Cap > 1) alert("Two consecutive capital letters!");
}
// -->
</script>
</head>
<body>
<form>
<input type="text" name="Name" value="" onkeyup="capitals(this)">
</form>
</body>
</html>