473,387 Members | 1,483 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,387 software developers and data experts.

Nueric pad keys

Hello to everyone,
do you know if it's possible (through a javascript in a HTML page) to
intercept when the user press the "." (period) key of the numeric pad and
replace it with a comma (italian "decimal point" is "comma" and I'm
developing an intranet apllication for an italian customer)

Thanks,
Davide
Jul 20 '05 #1
17 4049
Hello, Davide!

Here is the code:
-----------------------
<html>
<head>
<script language="javascript">
function CheckStr()
{
var f = document.myform.myedit.value;
re=RegExp('[.]','gi');
f=f.replace(re,',');
document.myform.myedit.value=f;
}

</script>
<body>
<form action="" name="myform">
<input type="text" name="myedit" onkeyup="CheckStr();">
<input type="submit">
</form>
</body>
</html>
-----------------

Did it help you?
Kindest Regards,
Olexiy Merenkov
http://www.merenkov.com/olexiy

Hello to everyone,
do you know if it's possible (through a javascript in a HTML page) to
intercept when the user press the "." (period) key of the numeric pad and
replace it with a comma (italian "decimal point" is "comma" and I'm
developing an intranet apllication for an italian customer)

Thanks,
Davide

Jul 20 '05 #2
Thank you Olexiy,
it works fine, but if I use the "period" key that is not on the numeric pad,
the script write a comma.
Do you know if it's possible to write a comma ONLY by pressing the period
key on the numeric pad?

(I can use Microsoft Internet Explorer specific features, because this is an
intranet application used only with Internet Explorer)

Thanks,
Davide.


Jul 20 '05 #3

Sorry but I don't understand what is this 'period key'. If you mean comma
that is up
the spacebar, it work ok for me...
Do you know if it's possible to write a comma ONLY by pressing the period
key on the numeric pad?


This code replaces commas after pressing the key so if you know undesired
symbol code
you can easily replace it by point '.' or with empty space ''

-
Kindest Regards,
Olexiy Merenkov
http://www.merenkov.com/olexiy

Jul 20 '05 #4

Sorry but I don't understand what is this 'period key'. If you mean comma
that is up
the spacebar, it work ok for me...
Do you know if it's possible to write a comma ONLY by pressing the period
key on the numeric pad?


This code replaces commas after pressing the key so if you know undesired
symbol code
you can easily replace it by point '.' or with empty space ''

-
Kindest Regards,
Olexiy Merenkov
http://www.merenkov.com/olexiy

Jul 20 '05 #5
Olexiy Merenkov wrote on 10 aug 2003 in comp.lang.javascript:
Sorry but I don't understand what is this 'period key'. If you mean comma


In the US they say [for unknown reasons] "period" for "point",
both meaning the "." character, Olexiy.

So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #6
Olexiy Merenkov wrote on 10 aug 2003 in comp.lang.javascript:
Sorry but I don't understand what is this 'period key'. If you mean comma


In the US they say [for unknown reasons] "period" for "point",
both meaning the "." character, Olexiy.

So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #7
>
So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.


Yes, also on an italian keyboard.
But in Italy the "decimal point symbol" is not a point (".") but a comma
(",").
So, if in the USA people wrotes 1,000.50 (one thousand and 50 pennies), in
Italy we usually wrote 1.000,50.
Some programs (like italian version of Microsoft Access for example) write a
comma when you press the "decimal point" of the numeric pad, but Internet
Explorer doesn't do this (and I want to do this in my web application).

Davide.
Jul 20 '05 #8
>
So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.


Yes, also on an italian keyboard.
But in Italy the "decimal point symbol" is not a point (".") but a comma
(",").
So, if in the USA people wrotes 1,000.50 (one thousand and 50 pennies), in
Italy we usually wrote 1.000,50.
Some programs (like italian version of Microsoft Access for example) write a
comma when you press the "decimal point" of the numeric pad, but Internet
Explorer doesn't do this (and I want to do this in my web application).

Davide.
Jul 20 '05 #9
Davide R. wrote on 11 aug 2003 in comp.lang.javascript:
So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.
Yes, also on an italian keyboard.
But in Italy the "decimal point symbol" is not a point (".") but a
comma (",").


Then it is not a "decimal point" but a "decimal comma" ;-)
So, if in the USA people wrotes 1,000.50 (one thousand and 50
pennies), in Italy we usually wrote 1.000,50.
Also here in the Netherlands
Some programs (like italian version of Microsoft Access for example)
write a comma when you press the "decimal point" of the numeric pad,
Terrible.
but Internet Explorer doesn't do this (and I want to do this in my web
application).


<input
onkeydown="if(event.keyCode==110){this.value+=','; return false}"
style="font-size:30pt;">

This only works if the cursor is on the far right !!!

=====================

<input
onkeydown="this.value=this.value.replace(/\./g,',')"
onblur="this.value=this.value.replace(/\./g,',')"
style="font-size:30pt;">

This works for all points, but on the next key or blur.

======================

Please warn your users beforehand !!!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #10
Davide R. wrote on 11 aug 2003 in comp.lang.javascript:
So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.
Yes, also on an italian keyboard.
But in Italy the "decimal point symbol" is not a point (".") but a
comma (",").


Then it is not a "decimal point" but a "decimal comma" ;-)
So, if in the USA people wrotes 1,000.50 (one thousand and 50
pennies), in Italy we usually wrote 1.000,50.
Also here in the Netherlands
Some programs (like italian version of Microsoft Access for example)
write a comma when you press the "decimal point" of the numeric pad,
Terrible.
but Internet Explorer doesn't do this (and I want to do this in my web
application).


<input
onkeydown="if(event.keyCode==110){this.value+=','; return false}"
style="font-size:30pt;">

This only works if the cursor is on the far right !!!

=====================

<input
onkeydown="this.value=this.value.replace(/\./g,',')"
onblur="this.value=this.value.replace(/\./g,',')"
style="font-size:30pt;">

This works for all points, but on the next key or blur.

======================

Please warn your users beforehand !!!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #11
>
<input
onkeydown="if(event.keyCode==110){this.value+=','; return false}"
style="font-size:30pt;">

This only works if the cursor is on the far right !!!


Great! It works
Any Idea when the cursor is not on the far right?

Davide.
Jul 20 '05 #12
>
<input
onkeydown="if(event.keyCode==110){this.value+=','; return false}"
style="font-size:30pt;">

This only works if the cursor is on the far right !!!


Great! It works
Any Idea when the cursor is not on the far right?

Davide.
Jul 20 '05 #13
"Davide R." <aa*@bb.com> wrote in message
news:bh**********@newsreader.mailgate.org...

So, if in the USA people wrotes 1,000.50 (one thousand and 50 pennies), in
Italy we usually wrote 1.000,50.


Actually, USA: 1,000.50 (one thousand and 50 pennies)
Italy: 1.000.000,50 (one million lira and a half)

Or roughly that much. I didn't check the latest conversion rate. ;-)

--
Steve

Jul 20 '05 #14
Steven Dilley wrote on 11 aug 2003 in comp.lang.javascript:
"Davide R." <aa*@bb.com> wrote in message
news:bh**********@newsreader.mailgate.org...
>

So, if in the USA people wrotes 1,000.50 (one thousand and 50
pennies), in Italy we usually wrote 1.000,50.


Actually, USA: 1,000.50 (one thousand and 50 pennies)
Italy: 1.000.000,50 (one million lira and a half)

Or roughly that much. I didn't check the latest conversion rate. ;-)


You heavily miss the point [or the comma], Steve:

Actually:

USA: 1,000.50

Italy: 1.128,36 (rate of 2 minutes ago)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #15
"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Davide R. wrote on 11 aug 2003 in comp.lang.javascript:
So the "Period key" on the numeric pad is
between the "0" and the "enter" on a US keyboard.


Yes, also on an italian keyboard.
But in Italy the "decimal point symbol" is not a point (".") but a
comma (",").


Then it is not a "decimal point" but a "decimal comma" ;-)


What is on the key? Does the keycap have a '.' or a ','?
Wouldn't a key with a point/period/dot which actually functions
as a comma would be confusing? If there is a comma on the key,
can't the keyboard (that is the kbd driver) be configured to send
a comma? Can't this be solved through the 'Locales' or 'Regional
Settings'?

Apologies for asking these questions, but living in the same country
as microsoft has some advantages: I haven't had to struggle through
any of this. I am just curious why a problem that is so widespread,
and that has been around for so long, hasn't been solved already.

-- Steve

Jul 20 '05 #16
Steven Dilley wrote on 11 aug 2003 in comp.lang.javascript:
Apologies for asking these questions, but living in the same country
as microsoft has some advantages: I haven't had to struggle through
any of this. I am just curious why a problem that is so widespread,
and that has been around for so long, hasn't been solved already.


We pity you there in the States, struggling with outdated idea's of square
inches that have to be converted to square feet or square miles, of filling
your car with quarters that are not even the same as those in England,
coding your dates month-day-year and not in a logical dmy or ymd form, like
we do [never missing our first date], and of trying to convince us [the
world] that 12 am and 12 pm are logically and not confusingly what they
should be [we stil don't know]. NASA even proved these unit conversion
mistakes by [thankfully?] crashing a spaceprobe on Mars.

Be assured, the grey decimal point key is a minor nusance.

Anyway it is very refreshing that you care, thank you very much Steven.

;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-} ;-}

PS: forgot to include Farenheit conversion to Kelvin and back. Farenheit
was an Amsterdammer, Lord Kelvin quite British.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #17
JRS: In article <3f******@10.10.0.241>, seen in
news:comp.lang.javascript, Steven Dilley <steven.dilley.at.compuware.com
@?.?> posted at Mon, 11 Aug 2003 10:58:30 :-
"Davide R." <aa*@bb.com> wrote in message
news:bh**********@newsreader.mailgate.org...
>

So, if in the USA people wrotes 1,000.50 (one thousand and 50 pennies), in
Italy we usually wrote 1.000,50.


Actually, USA: 1,000.50 (one thousand and 50 pennies)
Italy: 1.000.000,50 (one million lira and a half)


It's always instructive to see how /au fait/ some people are with
economic developments overseas. The Italian Lire was abandoned a year
and a half ago, at a conversion rate of 1936.27 lira.

To avoid ambiguity, the dot and comma should be referred to as the
decimal and thousands separators, in whichever order is applicable.

--
John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v4.00 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - w. FAQish topics, links, acronyms
Dates - miscdate.htm Year 2000 - date2000.htm Critical Dates - critdate.htm
Euro computing - eurocash.htm UK Y2k mini-FAQ: y2k_mfaq.txt Don't Mail News
Jul 20 '05 #18

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

Similar topics

3
by: Blair Hall | last post by:
I would like to determine whether two dictionaries have the same set of keys. Can anyone tell me if I HAVE to sort the key sequences as in this code snippet: # d1, d2 already created k1 =...
31
by: Robert Brown | last post by:
Let's say I have a type hierarchy: (just an example) the general entity customer: CREATE TABLE customer(customer_id int, customer_name varchar(250), customer_type int) three specific...
9
by: Etienne Charland | last post by:
Hi, there is an application running on a remote desktop (under Citrix ICA, but the same problem applies for RDC or PC Anywhere). Now, I want to send keys to the remote application from a local app....
0
by: OC | last post by:
Because of the requirements on a high-speed data entry form, I need to reliably trap certain keys (specifically the "/", "*", "-", and "+") keys on the 10-key pad and treat them as "Function keys"....
4
by: pixel | last post by:
hi i just discovered something strange when i use in ProcessCmdKey this construction switch(keyData) { case Keys.Left: {
14
by: vatamane | last post by:
This has been bothering me for a while. Just want to find out if it just me or perhaps others have thought of this too: Why shouldn't the keyset of a dictionary be represented as a set instead of a...
11
by: John | last post by:
I am coding a radix sort in python and I think that Python's dictionary may be a choice for bucket. The only problem is that dictionary is a mapping without order. But I just found that if the...
2
by: Charles Law | last post by:
I'll kick myself when you tell me, but ... I have a user control on a form, and I want the user control to see the arrow keys when I press them. If I press just about any other key the control's...
1
by: Sam Samson | last post by:
Greeetings All .. For my users convenience I have mapped function keys F2 .. F12 to change the tabs on the Tabcontrol. Works like a charm <ominous musicuntil one hits F8</ominous music> ...
0
by: Menlalen | last post by:
K E Y S , A L I C I A M P 3 D O W N L O A D *Fallin 2001* 'Keys, Alicia - Fallin' (http://tinyurl.com/4zg3sr) (3:30 4.82Mb 192kbps) 'Keys, Alicia - Fallin (ft BustaRhymes and Rampage)'...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...

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.