Good Morning All,
Below is the simplified output from an ASP that creates a form for the user to fill out. As you can see, we have a textarea for them to put comments in. We want to limit the size of the comments to 1500 characters. I created four javascript functions so I can check a couple different ways as to whether they put in more data than we want. This works for all Browser/OS combinations EXCEPT AOL's browser on a Mac. When they try to type in the textarea, all they get is a carat symbol ("^"
for each letter they type.
Any ideas on why this happens?
-Christian
Below is the simplified output from an ASP that creates a form for the user to fill out. As you can see, we have a textarea for them to put comments in. We want to limit the size of the comments to 1500 characters. I created four javascript functions so I can check a couple different ways as to whether they put in more data than we want. This works for all Browser/OS combinations EXCEPT AOL's browser on a Mac. When they try to type in the textarea, all they get is a carat symbol ("^"

Any ideas on why this happens?
-Christian
Code:
<html>
<head>
<script language="Javascript">
var sizeLimit = 1500;
function check(e)
{
var scanCode;
var target;
if (document.all)
{
e = window.event;
scanCode = e.keyCode;
target = e.srcElement;
}
else
{
scanCode = e.which;
target = e.target;
}
if ((scanCode <= 31) || (scanCode >= 127))
return true;
else
{
if (target.value.length >= sizeLimit)
return false;
else
return true;
}
}
function pastecheck(e)
{
var scanCode;
var target;
var userPaste = false;
if (document.all)
{
e = window.event;
scanCode = e.keyCode;
target = e.srcElement;
if ((e.ctrlKey == true) && (scanCode == 86))
userPaste = true;
}
else
{
scanCode = e.which;
target = e.target;
if (scanCode == 22)
userPaste = true;
}
if (userPaste == false)
return true;
else
{
if (target.value.length > sizeLimit)
{
alert('You pasted too much text into the textbox...truncated to proper length.');
target.value = target.value.substr(0, sizeLimit);
}
}
}
function lostfocus(e)
{
var target
if (document.all)
{
e = window.event;
target = e.srcElement;
}
else
{
target = e.target;
}
if (target.value.length > sizeLimit)
{
alert('You pasted too much text into the textbox...trancated to proper length.');
target.value = target.value.substr(0, sizeLimit);
}
}
</script>
</head>
<body>
<form name="EntryForm">
<textarea cols="60" rows="5" name="Comments1"></textarea>
<script language="javascript">
document.EntryForm.Comments1.onkeypress = check;
document.EntryForm.Comments1.onkeyup = pastecheck;
document.EntryForm.Comments1.onblur = lostfocus;
document.EntryForm.Comments1.onchange = lostfocus;
</script>
</form>
</body>
<html>