[thelist] maxlength on textarea? using JS?
Matthew Fischer
mfischer at e-fishsolutions.com
Thu Sep 28 12:25:53 CDT 2000
This works, obviously you could change when it's checked from the onChange to onSubmit for the form or onKeyup, etc.
<SCRIPT LANGUAGE="JavaScript">
<!--
function tooLong() {
if (document.pageForm.Babble.value.length > 255) {
alert('Please limit your babble to 255 characters.');
document.pageForm.Babble.focus();
}
}
//-->
</SCRIPT>
<textarea name="Babble" onChange="tooLong()">Enter up to 255 characters of Babble here</textarea>
On 9/28/00 at 12:41 PM, roselli at earthlink.net (aardvark) wrote:
>
> i know you can't have a 'maxlength' on a text area... and yes, we
> are going to do a check server-side for people without JS enabled...
>
> but for usability purposes, anyone have any JS handy that can tell
> the user that he/she has exceeded, say, 255 characters in a
> textarea with a JS alert? for IE and NN 4+? if not, then IE4+?
>
> anyone?
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
^^^^^^^^ >e}e}}@> ^^^^^^^^
Matt Fischer | e-fish solutions, inc.
877.WEB.FISH | 203.272.2987 | Fax 800.203.5816
mfischer at e-fishsolutions.com | http://e-fishsolutions.com
More information about the thelist
mailing list