?
Solved

Setting Value for keycode (or which) on Firefox

Posted on 2005-05-08
4
Medium Priority
?
687 Views
Last Modified: 2012-06-27
Hi Guys,

I've got some code that works in IE which takes the charcter you've typed in an input box and converts it to lower case.

objEvent.keyCode = lngKeyCode + 32;

Works fine in IE, but Firefox returns an error saying "setting a property that only has a getter".  Makes sense to me, I can't send a value to my objects keyCode in FF.

Can anyone please tell me how I can convert uppercase text to lowercase on the fly from an input box in FF?

Thanks!
Jet
0
Comment
Question by:jetgrrrl
  • 2
  • 2
4 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 2000 total points
ID: 13956696
Hi jetgrrrl,

Just use something like this:

<input type="text" onchange="this.value=this.value.toLowerCase();" />

or something like that using Javascript toLowerCase() function

Regards,
Zyloch
0
 
LVL 2

Author Comment

by:jetgrrrl
ID: 13956706
Hi Zyloch,

I understand that will work when the inputbox loses focus and notices it's changed.  Is there no way to do this on the fly?

Cheers,
Jet
0
 
LVL 36

Expert Comment

by:Zyloch
ID: 13956713
Why not use onkeypress instead of onchange?

Regards...
0
 
LVL 2

Author Comment

by:jetgrrrl
ID: 13956724
onkeypress still showed a capital until i typed something else, but onkeyup didn't so I'll go with that :)

Thanks!
Jet
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question