473,320 Members | 2,202 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,320 software developers and data experts.

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 1920
"ewosch" <wo***************@siemens.comwrote in
news:11**********************@l75g2000hse.googlegr oups.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.comwrote
in news:11**********************@l75g2000hse.googlegr oups.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.length; ++i) {
if (this.value.charCodeAt(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
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...
3
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...
1
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...
22
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)...
16
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...
5
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...
4
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... ...
6
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. ...
2
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;...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.