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
Solved

How can we capture ALT255 Character

Posted on 2002-07-09
5
329 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
  • 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 50 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
factorial example 4 47
Configure a Bean in an XML file 4 42
iterator/ListIterator approach 17 39
Java: anonymous class 4 29
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

856 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