473,795 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
18 5465
On Mon, 08 Nov 2004 18:04:34 -0500, DU <dr*******@hotN OSPAMmail.com>
wrote:
Jan Roland Eriksson wrote:
On 7 Nov 2004 07:00:25 -0800, or*********@hot mail.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*********@ho tmail.com (OrenFlekser) wrote in message news:<c1******* *************** ****@posting.go ogle.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*********@ho tmail.com (OrenFlekser) wrote in message news:<c1******* *************** ****@posting.go ogle.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*******@hotN OSPAMmail.com>
wrote:

Jan Roland Eriksson wrote:
On 7 Nov 2004 07:00:25 -0800, or*********@hot mail.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.vict oria.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******@librar y.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*******@hotN OSPAMmail.com>
wrote:
Jan Roland Eriksson wrote:
On Mon, 08 Nov 2004 18:04:34 -0500, DU <dr*******@hotN OSPAMmail.com>
wrote:
Jan Roland Eriksson wrote: On 7 Nov 2004 07:00:25 -0800, or*********@hot mail.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
3295
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 -> Internet Options -> Languages -> Add (choose language from list) -> Move Up (move language to top of list)
3
6620
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" content="en" /> means the language is english <meta name="language" content="zh" /> means the language is Simplified Chinese. Then I use a css selector to define different style for each language. My css code is
2
359
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 English. There are 4 ways that I have imagined how to do this, but I'm not sure which are practical, or easiest etc. 1. I was considering just adding the Tai to the existing labels and
6
3121
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 keyboard language by pressing ALT+SHIFT (or by changing the language manually elsewhere) each time he wants to shift from one language to another.
0
1275
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 "en-CA" (Canadian English) or "fr" (French), then retrieving the appropriate variables from the resx file with a ResourceManager depending on the current Culture. That seems straightforwrad enough. Whenever I want a label or any other control that...
2
1790
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 give solution for this
2
1817
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 org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label;
0
1884
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 every words and sentenses in required language in XML file and then we compare english text with the other coressponding language and get it
3
1831
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 application and in multiple languages, for example: Col1 - ID Col2 - English Col3 - French
0
9673
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10443
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
10216
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
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
6783
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
5437
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...
1
4113
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
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.