RO
-----Original Message-----
From: John Stanley [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:47 AM
To: CF-Talk
Subject: RE: textarea field limit
Yea, that's my arbitrary limit. Was dealing with a sql 6.5 db. You can
expand that number to whatever you need. Just make sure that the id of the
text field matches the object reference, and that the form name matches as
well. You dont have to use my names, but just change the function to whever
yours are called. The counter cell refers to a cell that I used to visually
tell the user how many characters they had left to type as they are typing.
-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:37 AM
To: CF-Talk
Subject: RE: textarea field limit
Thanks John. I'm new to _javascript_ some what. Is the "199" the limit of the
number of characters?
RO
-----Original Message-----
From: John Stanley [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:38 AM
To: CF-Talk
Subject: RE: textarea field limit
Sure is,
this is what I wrote, but I am sure it can be tweaked to be better; it
fires off of the onKeyDown method for a text area
function check_input_length(){
var the_counter;
the_counter = eval(199 - (document.lookup_form.note_text.value.length
+ 1));
if (the_counter < 0){
document.all.counter_cell.innerHTML = "0"
}
else{
document.all.counter_cell.innerHTML = the_counter;
}
if (the_counter <= 0){
document.lookup_form.note_text.value =
document.lookup_form.note_text.value.slice(0,199)
}
}
HTH
John
-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:28 AM
To: CF-Talk
Subject: textarea field limit
Is there any way to limit how much text is put into a textarea field via a
form? I want to prevent too many characters from being typed in similar to
the maxlength field in a onle line text box.
Thx.
Robert O.
_____
_____
_____
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

