Nueric垫键 [英] Nueric pad keys

查看:59
本文介绍了Nueric垫键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

你知道是否有可能(通过HTML页面中的javascript)

拦截当用户按下 "数字键盘的(句号)键和

用逗号替换它(意大利语小数点是逗号而我是

开发内联网适用于意大利客户)


谢谢,

Davide

解决方案

你好,Davide!


这是代码:

--------------------- -

< html>

< head>

< script language =" javascript">

函数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"名称= QUOT;为myedit" onkeyup =" CheckStr();">

< input type =" submit">

< / form>

< / body>

< / html>

-----------------


它对你有帮助吗?

最基本的问候,

Olexiy Merenkov
http://www.merenkov.com/olexiy

大家好,
你知道当用户按下。时,是否可以(通过HTML页面中的javascript)拦截
。数字键盘的(句号)键和
用逗号替换(意大利语小数点是逗号,我是为意大利客户开发内联网应用程序)

谢谢,
Davide



谢谢Olexiy,

它有效很好,但如果我使用期间不在数字键盘上的键,

脚本写一个逗号。

你知道是否可以通过按句号来写一个逗号<数字键盘上的
键是什么?


(我可以使用Microsoft Internet Explorer特有的功能,因为这是一个

使用的内部网应用程序仅限Internet Explorer)


谢谢,

Davide。



< blockquote>

很抱歉,但我不明白这个'期间密钥'是什么。如果你的意思是逗号

空格键好了,那么它对我来说还可以......

你知道吗?只需按下数字键盘上的句号
键就可以写一个逗号吗?




这个代码在按下键后会替换逗号,所以如果你知道不受欢迎的

符号代码

你可以通过点''''或者用空格''''轻松替换它。


-

最基本的问候,

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

解决方案

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



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.




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


这篇关于Nueric垫键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆