473,657 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

charset switching in input elements

Hallo,
I have a form with russion description of input elements (using
utf-8),
to be typed in with a russion keyboard.
In the input elements should only latin-1 be possible.
Is there a way to to this (without keyboard switching to english or
german) ?
I tried
<input type="text" charset="ISO-8859-1" />

but this does't work.
thanks
ewosch

Mar 14 '07 #1
2 1947
"ewosch" <wo************ ***@siemens.com wrote in
news:11******** **************@ l75g2000hse.goo glegroups.com:
Hallo,
I have a form with russion description of input elements (using
utf-8),
to be typed in with a russion keyboard.
In the input elements should only latin-1 be possible.
Is there a way to to this (without keyboard switching to english or
german) ?
I tried
<input type="text" charset="ISO-8859-1" />

but this does't work.
thanks
ewosch
So, your user is typing on a Russian keyboard, and you want the textbox
to show Latin-1?

Well, the input element doesn't have a "charset" property, so that
doesn't work.

Easy way: Tell your user to switch the keyboard to English or German
while filling out the form. And trust that they follow this instruction!

Another way, using javascript: Detect each keystroke, examine the
character, and ignore it if it isn't 0-255. Also, alert('You MUST use
English or German keyboard!');

Harder way for you, easier for the user, also using javascript: Re-map
all the keys on the keyboard. Detect each keystroke, look up the Cyrilic
character for that key, find the English character for that key, add it
to the textbox. This has been done:

http://www.google.com/search?q=javascript+map+keyboard

http://www.gar.no/gweb/gwebkbd.htm

Good luck!

Mar 14 '07 #2
Jim Land wrote:
"ewosch" <wolfgang.schra ...@siemens.com wrote
in news:11******** **************@ l75g2000hse.goo glegroups.com:
I have a form with russion description of input elements
(using utf-8),
to be typed in with a russion keyboard.
In the input elements should only latin-1 be possible.
[...]
Another way, using javascript: Detect each keystroke, examine
the character, and ignore it if it isn't 0-255.
For keyboard strokes:

<input type="text" onKeyPress="e = this.value"
onKeyUp="for (var i = 0; i < this.value.leng th; ++i) {
if (this.value.cha rCodeAt(i) 255) {
this.value = e
break
}
}
">

MSIE-fans could add onPaste="return false" and onDrop="return
false" .

--
Bart

Mar 14 '07 #3

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

Similar topics

12
3739
by: lawrence | last post by:
How do I get PHP to tell the server that when I echo text to the screen, I need for the text to be sent as UTF-8? How does Apache know the right encoding when all the text is being generated by PHP? If I build a content management system (I have) and I make sure that all input is encoded as UTF-8, how will the server know that the text in the MySql database is UTF-8? I'm taking all user input and using this function on the input: ...
3
4068
by: Lakshmi Narayanan | last post by:
Hi experts, My problem is, for password <input name="password" type="password"> element the size given is 20. For another one <input name="username"> is also 20. But in browser the size differs for Charset="UTF-8" only. How to make equal in display? the sample is here: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
1
1455
by: Konstantin Kivi | last post by:
I cannot get koi8r charset working propely after I tried to switch from 4.0.x In 4.0 I have server running with --default-character-set=koi8_ru and both mysql client and servlet application did what I wanted. After I upgraded to 4.1 gamma I cannot get things working, unless I run mysql client with --default-character-set=koi8r I tried to create database with both charset koi8r and utf8 and tried to run server with --default-charset...
22
13952
by: Jane Withnolastname | last post by:
I have been using the charset windows-1252 for a while, but it was pointed out to someone else in this group recently that it's a Microsoft creation (I'm sure I'm getting my facts wrong or skewed) and therefore not good for cross-platform browsing. Anyway, I am beginning my road to recovery (ie, breaking my addiction to authoring only for IE) and I would like to know what is the preferred charset? I have tried a search and only find...
16
6156
by: lawrence | last post by:
I was told in another newsgroup (about XML, I was wondering how to control user input) that most modern browsers empower the designer to cast the user created input to a particular character encoding. This arose in answer to my question about how to control user input. I had complained that I had users who wrote articles in Microsoft Word or WordPerfect and then input that to the web through a textarea box on a form I'd created. I've...
5
2503
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start code snipit** Dim strCustFullName as string Dim strCustAddr1 as string
4
2727
by: multimatum2 | last post by:
Hello, I need to enable/disable input text forms... But... I need to have the same style (color...) in both modes.. Could you help me ? Thanx a lot A small sample... <HTML><HEAD><TITLE></TITLE></HEAD>
6
4385
by: Dennis Allen | last post by:
Hi. I got a checkbox in a form. When the form is submitted, an email is generated. In the email text is the field name: on or off. The client doesn't want to see on or off, but yes or no. Question. Before I submit the form, is it possible to change the input from checkbox to text? If it was checked, have the value Yes, otherwise No?
2
2533
by: Ed Jay | last post by:
I'm dynamically creating several form input elements: mValue = integer constant; for(var j = 0; j < mValue; j++) { target = "imgCn"+ j; eName = "myFile"; eName = eName+jj; document.getElementById(target).innerHTML = "<input type = 'file' name="+eName+" value=''>text"; }
0
8413
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2742
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.