473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

left & right arrow ASCII char recognition, in ff

hi all
i have this function:
--
function userNameValidChars(e) {
if (!e) var e = window.event;
if (e.keyCode) key = e.keyCode;
else if (e.which) key = e.which;
if(!(key==37) && !(key==39))
return false;
return true;
}
<input type="text" onkeypress="return userNameValidChars(event)" />
--
I'm trying to block chars that been typed into this input element. but
i have this problem:
FF force u to define which CHARS are going to be typed inside this
input element.
IE doesn't force u. ffff does.
so i defined Backspace, Horizontal tab and left & right arrows
those two links r keyCode 37 & 39 (according to FF).
but those two r also ' & %.

my question is: what is the ASCII code for left and right arrows?
how can i allow FF to use left&right arrows in inputs i use this code
on?

Thanks a lot, NeoSwf

http://www.bbsinc.com/iso8859.html
ASCII table where left and right arrows are defined by AC & AE
http://www.lookuptables.com/
full ASCII table
Aug 14 '06 #1
1 9325


neoswf wrote:

how can i allow FF to use left&right arrows in inputs i use this code
on?
For Mozilla/Firefox the solution is to distinguish between the event
properties keyCode (for the arrow keys) and charCode (for characters
which have an Unicode codepoint), example is here:
<http://home.arcor.de/martin.honnen/javascript/2006/08/test2006081501.html>
The which property is is for backwards compatibility with Netscape 4, I
would not use it for Mozilla/Firefox where keyCode and charCode allow
finer control.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Aug 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Stephan Koser | last post by:
Hi, on my website i have some $rarr; tags - that shows usually a right arrow. Now I have Windows XP Professional and IE 6.0.x and it shows a square with a kind of a star. How can I get a right...
5
by: Randall Parker | last post by:
I am trying to take some very MS-specific HMTL and make it work in Mozilla and Opera. I see that there is a character that shows as a right arrow in IE that shows as an R in a circle in Moz and...
7
by: Computer Whizz | last post by:
Hi, I was just wondering if someone would like to comment on these two issues. I had a 15 minute wander around some sites and was curious about loading files (plain ASCII I think will do for a...
1
by: John M | last post by:
Hi, In recently recieved some excellent advice which ebnabled me to make a form behave as a spreadsheet with respect to the down and up arrow keys. To develop this further I would like the right...
7
by: Seash | last post by:
Hi friends , here is the sample code private void txtbox_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { if(e.KeyChar == 13) //enter { txtbox2.Focus(); }
4
by: Martin Fletcher | last post by:
when I execute dim strTEMP_DATA as string strTEMP_DATA = Encoding.ASCII.GetString(rBuffer).ToString I alway get a string without the closing quote. I see this in the 'Autos' window, I also...
27
by: Dr J R Stockton | last post by:
Unicode U+00B1 is &plusmn; - a plus sign sitting on top of a minus sign, possibly visible as "±"; "plus/minus", in ISO-7 coding. As Alan will no doubt remember, algebraic work requiring that...
2
by: Robert Dufour | last post by:
In Vs 2005 Vb.Net How do you detcet the arrow keys, the function keys, the Ctrl Key, The shift key, the PrintScreen key, scroll lock key NumLock key. I know how to detect the keys that return ascii...
5
by: Timeri | last post by:
This is a bit confusing until you actually see what I'm talking about but the main content of my page is not growing with the right column. I want the main content (left/larger column) to take into...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.