473,378 Members | 1,446 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,378 software developers and data experts.

Unicode in JavaScript textbox :?

Helo,

I have a text box, in which i want to display the unicode characters of
a particular language; on pressing of a key event. How can i accomplish
that.

What i am doing is


var data = new array();

data[65] = "ಕ" // on pressing a
data[66] = "ಖ" // on pressing b
.
.
.


function ck(e)
{
var key;
/* IE */
if(window.event)
{
key = e.keyCode;
}
/* NS/FF/OPERA */
else if(e.which)
{
key = e.which;
}
var word = document.getElementById("t1").value;
var result=word.replace(new RegExp(/\D/),"");

document.getElementById("t1").value = result + data[key];
}

// In body
.
.
.

<input type="text" id="t1" onkeyUp="(ck(event))">


what my problem is... I am not getting contineous unicode characters,
instead, i am getting alternate unicode and english alphabets
consequtively...

please help me

thank you
Apr 7 '07 #1
1 2460
acoder
16,027 Expert Mod 8TB
How about using += instead of setting to the result + date[key], then you only add your unicode characters.
Apr 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Hans | last post by:
Hi! Can someone explain how ASP works when it comes to unicode characters on the querystring? See the testcode below. If you type in a chinese character in the first textbox and click "post" the...
1
by: Mark Johnson | last post by:
I wonder if anyone has a solution? I wanted to use the web browser control as a 'zoom' box for a smaller textbox. I can format in the control, and save whatever formatting as HTML code back to the...
0
by: Mark Johnson | last post by:
The last reply got sort of cutoff. So here again: So for anyone interested, here's the simple regexp patterns for the substitutions required. The textbox control is being 'zoomed' in a popup...
4
by: Damon Reissman | last post by:
Hello, I'm trying to use Stephen Leban's RTF2 ActiveX control in an access database with unicode data. In VB, I pass the text value directly from the text box control in a form to the rtf2...
4
by: Greg | last post by:
I'm trying to write a basic tool to convert strings to unicode encodings. Should be easy enough, I can do the encoding bit with the various encoding tools in C#, but what I can't seem to do is...
5
by: Jonathan Seidner | last post by:
Hi, I have a program which contains a textbox, in this text box the user types this string: "\ub7c6\ub9d1\ubbd9\ubdc8\ubfcb\uc1b2\uc3a7\uc586\uc7a9\uc9b0\ucbfb" this is NOT a unicode string...
6
by: Jeff | last post by:
Hi - I'm setting up a streamreader in a VB.NET app to read a text file and display its contents in a multiline textbox. If I set it up with System.Text.Encoding.Unicode, it reads a unicode...
2
by: Frantic | last post by:
I'm working on a list of japaneese entities that contain the entity, the unicode hexadecimal code and the xml/sgml entity used for that entity. A unicode document is read into the program, then the...
9
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
OK I have some Chinese text in sql server column that looks like this: 12大专题调研破解广东科学发展难题 This is unicode? Anyway, I put this data into a text area like this:...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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...

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.