This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No scrolling in text input after uppercase ?

 
Jhun Hoon
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
Here's goes another lamentation of mine ...
I'm testing a simple input text such as this :

<input type=text name=text size=20 maxlength=30 onKeeUp=toUpCase(this)>

(sorry i replaced onkeyup to onkeeup, coz i cant post with the onkeyup)
where the function toUpCase is this :

function toUpCase(input) {
input.value = input.value.toUpperCase();
}

What i want is, as i type, the characters get upper-cased .. They work fine until the characters type exceeds the size of the input field (not yet exceeding the maxlength). In normal situation without the upper-casing, the input will scroll to the end of the string.

But in firefox 1.5 / netscape 7.1 i used, it doesnt scroll, the text get appended to the last string but the last char is not visible. (omigosh, so hard explaining it )

My friend said that it works fine on IE ..

Pls helppp ...
 
Jhun Hoon
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still cant achieve what i want, helpp ..

Please try this in firefox / netscape 7.1


[ December 29, 2005: Message edited by: Jhun Hoon ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be using onkeypress and you should have return true; as the last line in your function.

Eric
 
Jhun Hoon
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Sorry, i mis-edited the html .. The return true; should be in the jscript function. =p

If i use onkeypress or onkeydown, it'll scroll smoothly unlike the onkeyup, but with 1 catch, the last character i entered doesnt get uppercased.

I've already tried the combination of onkeypress, onkeydown, onkeyup with/without the return value, etc

Nothing works.. T_T
It seems so simple ...
 
Jhun Hoon
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any ideas folks ? T_T ...
Sorry to repost out of desperation, lol
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic