如何用Javascript控制textbox的輸入法﹖(在線等待......)
例如﹕在用拼音輸入法時﹐所輸入的結果都是英文字母而不是漢字
我知道在VB.NET可以用textbox.style("ime-Mode")="disabled"
不知道用Javascript怎么控制﹐請各位大俠指教!!!!!!!!!
例如﹕在用拼音輸入法時﹐所輸入的結果都是英文字母而不是漢字
我知道在VB.NET可以用textbox.style("ime-Mode")="disabled"
不知道用Javascript怎么控制﹐請各位大俠指教!!!!!!!!!
function IME_Mode()
{
document.all["txt_test"].style.cssText="ime-mode:disabled;";
}
</script>
<body onload="IME_Mode();"><input id="txt_test"></body>
elementID.style.imeMode = "value"
document.all.elementID.style.imeMode = "value"
Values: auto, active, inactive, and disabled. Example: <input id="myInput" type="text" size=60 value='This input control has ime-mode
property set to "inactive"'>
<button onclick="myInput.style.imeMode='active'">Set imeMode property to active</
button>
<button onclick="myInput.style.imeMode='inactive'">Set imeMode property to
inactive</button>
.disabled{ ime-mode:disabled; }<input id="myInput" type="text" size=60 class=disabled>
T1.disabled = true;
</script>
[a-zA-Z0-9]{100}
<!--
function textCounter(field, maxlimit) {
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
}
//-->
</SCRIPT>
<textarea name=words cols=73 rows=5 class="" onPropertyChange="textCounter(words,10)"></textarea>
后端﹕textbox.attributes.add("onkeydown","javascript:Control(this.form." & textbox.clientID & ",100);")
客戶端﹕
function Control(field,count)
{
if (field.value.length=100){
field.style.imeMode="disabled";
}
}
可是這樣用不行﹐為什么﹖我是這樣用的
后端﹕textbox.attributes.add("onkeydown","javascript:Control(this.form." & textbox.clientID & ",100);")
客戶端﹕
function Control(field,count)
{
if (field.value.length=100){
field.style.imeMode="disabled";
}
}
可是這樣用不行﹐為什么﹖