Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

issue with a textbox on firefox.

 
kamlendra kumar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i have a textbox on my page.i wanted to put restriction on max. number of charactors(100) in textbox so i created a javascript function and called it on the event "onkeypress".
the problem is
when textbox reaches to 100 charactor,it gets locked for the user,i mean it doesn't lets user delete the content,backspace also doesn't work.

can anyone help me.

with IE7 it doesn't gets locked.
thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kami the killer", please check your private messages for an important administrative matter.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why not just use the maxLength attribute?
 
kamlendra kumar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks buddy.
but the masLength attribute is present with TextBox,not with TextArea.
so i 'll have to fix that problem using javascript only.

the problem still persist.
 
Kartik Tal
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your very first post you told that you needed for Textbox and now you are asking for TextArea.
Just clarify it whether you are using textbox or textarea.
 
kamlendra kumar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh sorry buddy.
i'm using TextArea.

now can you help me please.....
 
Kartik Tal
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the code , in this code if you give more than 10 characters it will just erase them automatically.




 
kamlendra kumar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks alot.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64851
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kami the killer", please check your private messages for an important administrative matter. Again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic