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

Limiting the language in a text box to english only

Hi
I've posted this message couple of days ago, but I can't find it now,
so sorry if you see it twice...

Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.

Thanks alot - Oren
Jul 23 '05 #1
18 5424
or*********@hotmail.com (OrenFlekser) wrote:
Hi
I've posted this message couple of days ago, but I can't find it now,
so sorry if you see it twice...

Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.


Here's the entire set of messages telling you that you can't do this:

http://groups.google.com/groups?selm...ing.google.com

Oh--besides everything already written, what makes you think everyone
who sees your page has his machine configured to use English in the
first place?

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ter le premier point de mon adresse de courriel.
Jul 23 '05 #2
On 7 Nov 2004 07:00:25 -0800, or*********@hotmail.com (OrenFlekser)
wrote:
Anyways - I have a text box, and I want my users to be able to write
only in english inside it.


How are you suggesting to stop my fingertips from typing any random
sequence of letters in a text box?

Some of those character sequences might just possibly end up being words
in e.g. Swedish while some other sequences might look suspiciously much
like words in English?

Either you need to rephrase your question to make it understandable, or
you need to stop and think for a minute.

--
Rex (who posts in English from a PC configured to Swedish)
Jul 23 '05 #3
DU
Jan Roland Eriksson wrote:
On 7 Nov 2004 07:00:25 -0800, or*********@hotmail.com (OrenFlekser)
wrote:

Anyways - I have a text box, and I want my users to be able to write
only in english inside it.

How are you suggesting to stop my fingertips from typing any random
sequence of letters in a text box?


Maybe with an onkeyup event handler checking if the character typed is
listed in the english character set. If not, then cancelling the event.

Also,

http://www.w3.org/TR/html4/interact/...accept-charset
Some of those character sequences might just possibly end up being words
in e.g. Swedish while some other sequences might look suspiciously much
like words in English?

Either you need to rephrase your question to make it understandable, or
you need to stop and think for a minute.

I think his question was understandable. Like many many posts in
newsgroups, his post lacked webpage context, webpage analysis,
explanations, descriptions as to why he wants to do this and why/how he
ended up with such solution.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.3 :)
Jul 23 '05 #4
or*********@hotmail.com (OrenFlekser) wrote in
news:c1**************************@posting.google.c om:
Hi
I've posted this message couple of days ago, but I can't find it now,
so sorry if you see it twice...

Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.

Thanks alot - Oren


Sorry for your getting bombarded with phony answers from the other people
on the newsgroup. There is a way to achieve this, with a simple (but
rather difficult) step-by-step process.

You need to spectrally manipulate your text box so that it rejects all
typing that is possessed by an aura of malice. This is the easy part.
The hard part is defining non-English text as that which contains an aura
of malice.

The defining is the difficult part. In order to do so, you must first
put your page on the Web, at whatever location it will be in the future.
(The address and contents of the file must _not_ change.) Then, you need
to type into the text box a representative sample of twenty-six English
words, each beginning with a different letter. Then you must copy the
text you have just typed and repaste it into the text box twenty-six
times, but between each pasting, you must type a letter of the QWERTY
keyboard, starting at Q and finishing at M, from left to right. Each
time you paste the text, you must say the letters of the alphabet
backwards, quickly! (This is the hard part.) If you are too slow, in
reciting backwards, the whole procedure might not work. When the Twenty-
Six Pastings are complete, submit the form by double-clicking.

In the submission process, the words of the form will transform into the
works of Shakespeare. You will not see this, because they get
transformed in their transmission to the server (a target script is not
necessary). The server will not see this either, unless it has a perfect
number of transistors that is prime.

Now that you have successfully defined the English langauge as non-
malicious (as shown by the miraculous transformation into the works of
Shakespeare), the form will automatically consider non-English text as
malicious. Now, all you need to do is tell the form to reject malicious
text. Do this by adding the minimized, WC3-approved attribute,
"raboof," as shown below.

<input type="text" name="whatever" raboof>

or do the same with a textarea.

This must be done after the pasting procedure, and note that this only
works with HTML. The WC3 does not recommend use of the raboof attribute
with XHTML, as the use of raboof="raboof" has not been thoroughly tested.
There are some reports of success with raboof="", though. Some people
suggest using raboof=" ", and some even advocate using two spaces.

Once you've set this up, people who type in non-English will receive a
small shock to their fingers and a popup alert message. The shock only
works with Thinkpads and Microsoft keyboards, though.

Note that in defining the English language's aura, you also define the
aura of the keyboard layout. In order to allow Dvorak layout users to
type, you need to repeat the process of pasting with the Dvorak layout,
going from P to Z.

Good luck with this. Be careful about getting the right order in your
recitation of the alphabet; otherwise your computer might crash (but it
will restart fine. The crash is just annoying). Also, be careful about
your representative sample of words. A friend of mine from Providence
told me that his form would only accept French, after he had used words
like Garage for G and Quiche for Q.
Jul 23 '05 #5
Sam Hughes wrote:
In the submission process, the words of the form will transform into the
works of Shakespeare. You will not see this, because they get
transformed in their transmission to the server (a target script is not
necessary). The server will not see this either, unless it has a perfect
number of transistors that is prime.


Apart from 2, all primes are odd numbers. From this page:

http://www-gap.dcs.st-and.ac.uk/~his...t_numbers.html

we read that:

"we know that an odd perfect number would have to have at least eight
distinct prime factors, and at least 29 prime factors which are not
necessarily distinct. It is also known that such a number would have
more than 300 digits and a prime divisor greater than 106. The problem
of whether an odd perfect number exists, however, remains unsolved."

....so there's no such thing as a perfect prime. This fact has to call
into question the validity of the rest of the information in your post.

--
Mark.
http://tranchant.plus.com/
Jul 23 '05 #6
Mark Tranchant <ma**@tranchant.plus.com> wrote in
news:41***********************@ptn-nntp-reader02.plus.net:
Sam Hughes wrote:
In the submission process, the words of the form will transform into
the works of Shakespeare. You will not see this, because they get
transformed in their transmission to the server (a target script is
not necessary). The server will not see this either, unless it has a
perfect number of transistors that is prime.


Apart from 2, all primes are odd numbers. From this page:

http://www-gap.dcs.st-and.ac.uk/~his...ct_numbers.htm
l

we read that:

"we know that an odd perfect number would have to have at least eight
distinct prime factors, and at least 29 prime factors which are not
necessarily distinct. It is also known that such a number would have
more than 300 digits and a prime divisor greater than 106. The problem
of whether an odd perfect number exists, however, remains unsolved."

...so there's no such thing as a perfect prime. This fact has to call
into question the validity of the rest of the information in your
post.


I think the question of there being a perfect prime has a more obvious
explanation than that. A perfect number is one for which the sum of its
proper factors equals itself. Every prime has only one proper factor, the
number one, and because all primes are not equal to one, none are perfect
-- they are as far from perfect as a whole number can be.

The fact that no servers can see the transformed text does not mean the
rest of the information is false. How you decided upon that, I have no
idea. When the procedure is correctly carried out, this method works. I
guarantee this. If you do not believe me, try it yourself.
Jul 23 '05 #7
or*********@hotmail.com (OrenFlekser) wrote in message news:<c1**************************@posting.google. com>...
Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.


I'm unaware of an "Alt+Shift" option to "switch languages" -- what
browser and platform has this?

Do you wish your site to require *correct* English (for instance,
rejecting "english" if typed without a capital "E")? Should the site
consider "rendezvous" to be English or French?

--
Dan
Jul 23 '05 #8
da*@tobias.name (Daniel R. Tobias) wrote in
news:aa*************************@posting.google.co m:
or*********@hotmail.com (OrenFlekser) wrote in message
news:<c1**************************@posting.google. com>...
Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.


I'm unaware of an "Alt+Shift" option to "switch languages" -- what
browser and platform has this?


XP Windows. I use it to switch keyboard layouts, or I try to, except that
it randomly fails to work (with randomly meaning ALWAYS). It says it
should work, at least.
Jul 23 '05 #9
On 9 Nov 2004 15:32:14 GMT, Sam Hughes <hu****@rpi.edu> wrote:

....
You need to spectrally manipulate your text box so that it rejects all
typing that is possessed by an aura of malice. This is the easy part.
The hard part is defining non-English text as that which contains an aura
of malice.

....

Message / Keep :-)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 23 '05 #10
On Mon, 08 Nov 2004 18:04:34 -0500, DU <dr*******@hotNOSPAMmail.com>
wrote:
Jan Roland Eriksson wrote:
On 7 Nov 2004 07:00:25 -0800, or*********@hotmail.com (OrenFlekser)
wrote:
Anyways - I have a text box, and I want my users to be able to write
only in english inside it.
How are you suggesting to stop my fingertips from typing any random
sequence of letters in a text box?

Maybe with an onkeyup event handler checking if the character typed is
listed in the english character set. If not, then cancelling the event.


Aha! So any randomly typed sequence of characters within the range of
[A-Za-z] constitutes English?

No wonder I have had trouble deciphering some of the messages in this NG
then. Thanks for making my day, I needed that :-)

--
Rex
Jul 23 '05 #11
On 9 Nov 2004 11:27:32 -0800, da*@tobias.name (Daniel R. Tobias) wrote:
or*********@hotmail.com (OrenFlekser) wrote in message news:<c1**************************@posting.google. com>...
Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.


I'm unaware of an "Alt+Shift" option to "switch languages" -- what
browser and platform has this?


It's a Windows thing that has been around for many versions of that
OP-system as I do remember.

You do need a Win platform and you do need to install more than one
language option in it. For US sold PC's that never happens, they come
defaulted to the limited US language keyboard layouts with no other
option available.

Personally I can toggle between English and Swedish keyboard layouts
with the "Left-Alt+Shift" option on my Swedish keyboard. Not that I
would like that much though, because my Swedish keyboard starts to work
funny.

As only one example, my very normal keys for characters '', '' and ''
becomes '{', '"' and ':' and there are other characters that changes
place on the keyboard too, basically I lose typing speed doing it.

Note that the normal US-English character set is just a subset of what
we use in the rest of the world so I have no problems what so ever to
write a message in English on a Swedish keyboard. All US-English
characters are there, and more.

In fact there is a difference between the standard US-English keyboard
and the "Queens English" keyboard layout too. From a Win point of view
they are considered to be two different languages :-)

--
Rex
Jul 23 '05 #12
Jan Roland Eriksson (jr****@newsguy.com) wrote:
: On 9 Nov 2004 11:27:32 -0800, da*@tobias.name (Daniel R. Tobias) wrote:

: >or*********@hotmail.com (OrenFlekser) wrote in message news:<c1**************************@posting.google. com>...
: >> Anyways - I have a text box, and I want my users to be able to write
: >> only in english inside it. I want to prevent the Alt+Shift option of
: >> switching to other languages.
: >
: >I'm unaware of an "Alt+Shift" option to "switch languages" -- what
: >browser and platform has this?

: It's a Windows thing that has been around for many versions of that
: OP-system as I do remember.

: You do need a Win platform and you do need to install more than one
: language option in it. For US sold PC's that never happens, they come
: defaulted to the limited US language keyboard layouts with no other
: option available.

Not exactly true. The Alt key plus the numeric keypad allows you to enter
arbitrary values, (and the character to which the value refers then
depends on the character set in use). (for 8 bit character sets, that is,
I'm not sure how this ties into character values for unicode where the
value is > 256)
Jul 23 '05 #13
DU
Jan Roland Eriksson wrote:
On Mon, 08 Nov 2004 18:04:34 -0500, DU <dr*******@hotNOSPAMmail.com>
wrote:

Jan Roland Eriksson wrote:
On 7 Nov 2004 07:00:25 -0800, or*********@hotmail.com (OrenFlekser)
wrote:

Anyways - I have a text box, and I want my users to be able to write
only in english inside it.
How are you suggesting to stop my fingertips from typing any random
sequence of letters in a text box?


Maybe with an onkeyup event handler checking if the character typed is
listed in the english character set. If not, then cancelling the event.

Aha! So any randomly typed sequence of characters within the range of
[A-Za-z] constitutes English?


Where have I suggested anything remotedly close to that?
An English webpage starts with a properly defined root element with an
accordingly defined lang attribute.
No wonder I have had trouble deciphering some of the messages in this NG
then. Thanks for making my day, I needed that :-)


I don't understand your arrogance here. I was merely trying to provide a
possible solution to the OP post. I did not suggest my post was the
ultimate and definitive solution. In the chuncks you intentionally
snipped without even indicating so, I certainly recommended to the OP to
provide more explanations, contextual info, etc...

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.3 :)
Jul 23 '05 #14
Jan Roland Eriksson wrote:
You do need a Win platform and you do need to install more than one
language option in it. For US sold PC's that never happens, they come
defaulted to the limited US language keyboard layouts with no other
option available.
Don't they at least have the US-International keyboard layout? This can
be useful for typing characters with accents, as it has dead keys. (Note
that it is possible to create two "languages", both English, with two
different keyboard layouts, say US and US-International, and switch
between them with Left-Alt+Ctrl).
In fact there is a difference between the standard US-English keyboard
and the "Queens English" keyboard layout too. From a Win point of view
they are considered to be two different languages :-)


No, they are two different keyboard layouts. Windows (at least later
versions, don't know about earlier ones) makes a sensible distinction
between language and keyboard layout.

Gertjan.

--
Gertjan Klein <gk****@xs4all.nl>
Jul 23 '05 #15
In <41******@news.victoria.tc.ca>, on 11/09/2004
at 03:06 PM, yf***@vtn1.victoria.tc.ca (Malcolm Dew-Jones) said:
Not exactly true. The Alt key plus the numeric keypad allows you to
enter arbitrary values,


That has nothing to do with switching languages.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to sp******@library.lspace.org

Jul 23 '05 #16
OrenFlekser wrote:
I've posted this message couple of days ago, but I can't find it now,
so sorry if you see it twice...
Hmm... I wonder why it was ignored the first time. Perhaps because you
have not phrased your question in any useful way. However, you've done
a good job at recieving some rather hilarious replies which kept me
entertained for a little while. :-)
Anyways - I have a text box, and I want my users to be able to write
only in english inside it. I want to prevent the Alt+Shift option of
switching to other languages.


As has been mentioned, it is impossible to successfully limit user input
to a specifc language. However, my crystal ball is telling me that this
is actually a character encoding issue, and if, for example, you're
using ISO-8859-1 when a user enters characters that don't exist in that
character set, then those characters get screwed up in your system and
don't display properly when output to a web page. It's a fairly common
problem,a nd the only reason I can think of for you wanting to restrict
to, what I assume means, ASCII characters.

The best way to handle this is to use UTF-8, which, being unicode, can
accept all characters a user can possibly enter. So, if I want to enter
some random smiley ☺ faces ☻ and non-ascii characters, or even write in
العربrية (Aabic), 台語 (Chinese), தமிழ் (Tamil), or any other language,
then the only problems are caused if you don't have unicode fonts
available on your system to read it.

The only other way is to use server side validation to ensure that all
characters submitted are valid, and return an error message to the user
if they are not.

--
Lachlan Hunt
http://lachy.id.au/
http://GetFirefox.com/ Rediscover the Web
http://SpreadFirefox.com/ Igniting the Web
Jul 23 '05 #17
On Tue, 09 Nov 2004 23:39:15 -0500, DU <dr*******@hotNOSPAMmail.com>
wrote:
Jan Roland Eriksson wrote:
On Mon, 08 Nov 2004 18:04:34 -0500, DU <dr*******@hotNOSPAMmail.com>
wrote:
Jan Roland Eriksson wrote: On 7 Nov 2004 07:00:25 -0800, or*********@hotmail.com (OrenFlekser)
wrote:
>Anyways - I have a text box, and I want my users to be able to write
>only in english inside it. How are you suggesting to stop my fingertips from typing any random
sequence of letters in a text box? Maybe with an onkeyup event handler checking if the character typed is
listed in the english character set. If not, then cancelling the event.
Aha! So any randomly typed sequence of characters within the range of
[A-Za-z] constitutes English? Where have I suggested anything remotedly close to that?
Few lines above from here?

Partial quote from the OP ...
"only in english"

Partial quote from you ...
"checking if the character typed is listed in the english character set"
An English webpage starts with a properly defined root element with an
accordingly defined lang attribute.
That part of markup is only a _hint_ that the major part of the page
content /may/ be written in english, nothing more. It certainly does not
prohibit any one from typing jibberish in any text box that might be
presented, not even if it's combined with your suggested method of
checking for valid characters.
No wonder I have had trouble deciphering some of the messages...

I don't understand your arrogance here.
There was no intent to be arrogant...
I just forgot that humor is OT here, sorry :-)
I was merely trying to provide a possible solution to the OP post.
As seen from a technical aspect; you did not succeed.

Even if you start to check typed characters to see if they belong to a
certain language character repertoire, your method will fail totally to
indicate the language in use.

E.g. let's take the word 'park'

In English it might mean "a specifically defined natural environment" in
one context but the same word can also be used as "I need to park my
car".

In Swedish, the exact same word is used as a "label" for "a specifically
defined natural environment".

Note that the spelling of 'park' is identical in English and Swedish and
at least one of its meanings is a shared property between the two
languages.

Now how should I use your suggested character check method to help me
decide the language in use when some one types 'park' in my text box?
...I certainly recommended to the OP to provide more explanations,
contextual info, etc...


Sure, no argument there.

All the best...

--
Rex
Jul 23 '05 #18
On Wed, 10 Nov 2004 09:20:01 +0100, Gertjan Klein <gk****@xs4all.nl>
wrote:
Jan Roland Eriksson wrote:
You do need a Win platform and you do need to install more than one
language option in it. For US sold PC's that never happens, they come
defaulted to the limited US language keyboard layouts with no other
option available.
Don't they at least have the US-International keyboard layout?


Double checking my "HP Pavilion ze4325us" laptop, purchased at "Best
Buy" in Cincinnati with Win-XP pre-installed, less than one year ago.

Nope, no extravagant keyboard functions there :-)

(but Win-XP allows me to install support for other languages and
keyboard layouts on this laptop too of course, it just did not come with
any extras available "out of the box")

[...]
In fact there is a difference between the standard US-English keyboard
and the "Queens English" keyboard layout too. From a Win point of view
they are considered to be two different languages :-)

No, they are two different keyboard layouts. Windows (at least later
versions, don't know about earlier ones) makes a sensible distinction
between language and keyboard layout.


Maybe that's your experience; mine is that a major MS-Win application do
change its selection of default spell/grammar checker database too.

--
Rex
Jul 23 '05 #19

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

Similar topics

5
by: Gustaf Liljegren | last post by:
In IE (at least from version 5), you can change your prefered language, so that for example the Windows Update page appears in another language than the system default. Here's the process: Tools...
3
by: Lian Liming | last post by:
Hi, The language in my web site may be Simplified Chinese or English. I want to define different styles for each language. For each language, the http header is different. <meta name="language"...
2
by: OM | last post by:
Hi, I have a simple Access application, for recording fuel use, and generating a few reports. It is necessary that the forms (such as the menu, and data entry forms) be in Thai as well as...
6
by: Michelle Stone | last post by:
Hi I am doing a bilingual .NET application for English/Arabic. On a web form, I have some edit boxes for data entry in Arabic and some for entry in English. Right now the user has to change his...
0
by: marcus | last post by:
I am developing a web site at work that needs to be both in French and English. I have been reading up on using resource files (.resx files) in combination with setting the CultureInfo to either...
2
by: saravanan.arul | last post by:
Hi this sarav... I having some languages in dropdownlist(like english,tamil,japan.......) based on this dropdown selection full application need to change corresponding language.. Anyone...
2
by: erag | last post by:
Hi im newbie to java, and i want to set the language change according to main page..how to create it? here is my coding: main page: import org.eclipse.swt.SWT; import...
0
by: sivamedia | last post by:
hai to all I want to Translate the given English Text into some other language for Example English - French, English - Hindi etc. i found that 1)we have to enter the database of each and...
3
by: Alex | last post by:
Hi, We're working on what will become a multi-language application, and I wanted to see if this idea is feasable. What we're thinking of doing is creating a table to contain all text of the...
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:
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.