当前位置: 技术问答>java相关
在jsp页面上如何控制当光标进入文本框时,输入法强制改为全角
来源: 互联网 发布时间:2017-04-13
本文导语: 因为项目的特殊要求,某些栏位的数据必需是全角的,所输入的字母、数字都必需是全角的,请大侠们提示一下用什么技术切换输入法(状态),还有,怎么让用户在当前输入框不能自己切换状态? | ...
因为项目的特殊要求,某些栏位的数据必需是全角的,所输入的字母、数字都必需是全角的,请大侠们提示一下用什么技术切换输入法(状态),还有,怎么让用户在当前输入框不能自己切换状态?
|
你 只能做到打开与关闭
INPUT TYPE = text STYLE = "ime-mode:active" >
auto Default. IME is not affected. This is the same as not specifying the ime-mode attribute.
active All characters are entered through the IME. Users can still deactivate the IME.
inactive All characters are entered without IME. Users can still activate the IME.
disabled IME is completely disabled. Users cannot activate the IME if the control has focus.
INPUT TYPE = text STYLE = "ime-mode:active" >
auto Default. IME is not affected. This is the same as not specifying the ime-mode attribute.
active All characters are entered through the IME. Users can still deactivate the IME.
inactive All characters are entered without IME. Users can still activate the IME.
disabled IME is completely disabled. Users cannot activate the IME if the control has focus.
|
这样把
当光标离开input时触发onblur()
然后提交一个隐藏Frame给一个jsp,把输入的内容穿过去
用这个jsp判断,弹出窗口
具体判断请参考汉字编码,我很模糊了,高8位不是空就是全角,好象是。
当光标离开input时触发onblur()
然后提交一个隐藏Frame给一个jsp,把输入的内容穿过去
用这个jsp判断,弹出窗口
具体判断请参考汉字编码,我很模糊了,高8位不是空就是全角,好象是。
|
干甚么非要在输入时变成全角呀,为什么不能在提交时把半角的符号都替换成全角,这样不是更简单吗?