de*******@gmail .com wrote:
Is there anyway to detect if scrollbars were made visible in a
textarea? I'm not talking about initial setting of the scrolling
attribute, but rather whether scrollbars have been added either
horizontally or vertically based on the users text input?
Thanks,
Cliff.
Have a play at this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<form>
<input type="text" name="sc" value="">
<br>
<textarea
rows="3"
cols="24"
wrap="soft"
onkeyup="
sH.value=a=this .scrollHeight;
oH.value=b=this .offsetHeight;
sW.value=c=this .scrollWidth;
oW.value=d=this .offsetWidth;
sc.value=(a>b|| c>d)?'scrolling ...':''"></textarea>
<hr>
<input type="text" name="sH" value="">__scro llHeight
<br>
<input type="text" name="oH" value="">__offs etHeight
<hr>
<input type="text" name="sW" value="">__scro llWidth
<br>
<input type="text" name="oW" value="">__offs etWidth
<hr>
</form>
</body>
</html>
Some sort of algorithm in there somewhere...