?
Solved

How can we capture ALT255 Character

Posted on 2002-07-09
5
Medium Priority
?
361 Views
Last Modified: 2012-06-27
Hi All

When we Type while Pressing ALT, 255, then we get a special character like Space(" "). How can we capture this character with JavaScript.

Thanks
Sanjay Saluja
0
Comment
Question by:ssaluja
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 9

Expert Comment

by:Venci75
ID: 7140713
<input type=text name=txt>
<button onclick="for (i=0; i<txt.value.length; i++) if (txt.value.charAt(i) == ' ') alert('255 found'); else alert('OK');"
0
 
LVL 9

Expert Comment

by:Venci75
ID: 7140715
... txt.value.charAt(i) == ' ' ...
this here is typed by using ALT+255
0
 

Author Comment

by:ssaluja
ID: 7142896
Hi Venci75

I have checked both ways but it is not handling it, since it is not a simple BLANK space ' '. So Please tell me if any other way out is there..


Thanks
Sanjay
0
 
LVL 9

Accepted Solution

by:
Venci75 earned 200 total points
ID: 7142994
ok - you can then try something like this:

<input type=text name=txt>

<button onclick="if (txt.value.indexOf(String.fromCharCode(<code>)) >=0) alert('255 found'); else alert('OK');">

but this won't work in all cases. You must check what is the code of the 255 character in ISO-Latin-1 codeset.

on my computer it is 160 - so this should be:
... String.fromCharCode(160) ...


btw: the previous suggestion will work if you type in ALT+255 where you think it is space
0
 
LVL 35

Expert Comment

by:girionis
ID: 8916805
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to Venci75

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This video teaches viewers about errors in exception handling.
Suggested Courses

649 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