Solved

How can we capture ALT255 Character

Posted on 2002-07-09
5
342 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

688 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