Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

textarea maxlength

  Asked By: Koila    Date: Jan 26    Category: Java    Views: 1111
  

I have a textarea in my form :

<html:textarea property="msgText" rows="10" cols="40" disabled="false" onmouseup="checkLength()" onkeyup="checkLength()" />

i need to set a maxlength for that, but the problem is that there is no such attribute for this tag, so im calling a function to do this,
my problem is that im calling this function on all the events on textarea, such as onmouseup, onkeyup, onkeydown and ...but i think onmouseup and/or onmousedown are not working properly specially in Firefox(it sometimes work in IE). So when I copy and paste using the mouse none of these events are called, any idea how to handle this?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Jaime Bowman     Answered On: Jan 26

i didn't find any event dedicated for what you want. but you can solve your problem  with onblur and onmouseout event. couse for submitting the form, this textarea  ahould get lost its focus and therefore one of these events  will be fired.
the test file is attached as HTML.

 
Didn't find what you were looking for? Find more on textarea maxlength Or get search suggestion and latest updates.




Tagged: