charset switching in input elements

E

ewosch

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
 
B

Bart Van der Donck

Jim said:
[...]
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" .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,091
Latest member
PeakCBDIngredients

Latest Threads

Top