just cause im bored ... here goes ...
var myFixedValue = 25;
function checkLength() {
if (document.theform.blah.value.length > myFixedValue) {
document.theform.blah.value =
document.theform.blah.value.substring(0,myFixedValue);
}
}
<form name="theform">
<textarea name="blah" onChange="oneliner()"></textarea>
</form>
of if youre a fan of oneliners in javascript :P
function oneliner() { document.theform.blah.value =
(document.theform.blah.value.length > myFixedValue) ?
document.theform.blah.value.substring(0,myFixedValue) :
document.theform.blah.value; }
im too lazy so i havent tested ir properly but it works here on ... i
dunno which browsers support onChange ... onBlur would probably work just
as well ... and if its all broken then im really sorry to have wasted your
time but it should point you in the right direction ...
>Anyone got a nice simple script that does it without any horrible
>downcounting text boxes or anything?
Lee Hosty -x- hostyle at skynet.ie -x- +353 (0)86 8768780
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!