|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Textarea Max Size form question
Author: Barney Boisvert
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161735
You want to use onKeyUp, not onKeyPress, because onKeyPress fires before the
character is actually typed. In other words, you trim the string, recount
the chars, whatever, and then the character is appended, throwing everything
off immediately.
Cheers,
barneyb
----- Excess quoted text cut - see Original Post for more -----
Author: Tony Weeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161733
np
tw
> there is a thread in the last 30 days that discusses this, check the
> hof site...its there.
>
>
http://www.houseoffusion.com/cf_lists/index.cfm/method=messages&threadid=317
> 24&forumid=4
>
> tony
Yeah, the script I dug up was basically the same thing...I kept thinking
that I had to submit the form to test that, and completely forgot about the
"onkeyup() and onkeypress() events..
Thanks tony!
Author: Jeff Small
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161732
> there is a thread in the last 30 days that discusses this, check the hof
> site...its there.
>
>
http://www.houseoffusion.com/cf_lists/index.cfm/method=messages&threadid=317
> 24&forumid=4
>
> tony
Yeah, the script I dug up was basically the same thing...I kept thinking
that I had to submit the form to test that, and completely forgot about the
"onkeyup() and onkeypress() events..
Thanks tony!
Author: Barney Boisvert
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161730
<script>
function checkLength(field, len) {
if(field.value.length > len)
field.value = field.value.substr(0, len);
}
</script>
<form>
<textarea onKeyUp="checkLength(this, 10);"></textarea>
<input onKeyUp="checkLength(this, 12);" />
</form>
----- Excess quoted text cut - see Original Post for more -----
Author: Jeff Small
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161729
----- Excess quoted text cut - see Original Post for more -----
perhaps?
> I'm not using CFINPUT on any of the other form elements though...
Digging a little further, I found this...it rules...
http://javascript.about.com/library/scripts/blcounttext.htm
Author: Tony Weeg
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161728
there is a thread in the last 30 days that discusses this, check the hof
site...its there.
http://www.houseoffusion.com/cf_lists/index.cfm/method=messages&threadid=317
24&forumid=4
tony
Okay, so you've got a textarea...you want to make sure it's not more than
1024 characters, but you wanna do a clientside check on it...
<keanu reeves>
What do you do...what DO you do?
</keanu reeves>
Any scripts or dreamweaver behaviors anyone know of that can be plugged in
quickly for an onblur() check? Is there a CFINPUT solution to this perhaps?
I'm not using CFINPUT on any of the other form elements though...
Author: Jeff Small
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32230#161727
Okay, so you've got a textarea...you want to make sure it's not more than
1024 characters, but you wanna do a clientside check on it...
<keanu reeves>
What do you do...what DO you do?
</keanu reeves>
Any scripts or dreamweaver behaviors anyone know of that can be plugged in
quickly for an onblur() check? Is there a CFINPUT solution to this perhaps?
I'm not using CFINPUT on any of the other form elements though...
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||