文本框获得焦点时,自动切换到中文输入法。谢谢各位大侠

解决方案 »

  1.   

    ime-mode : auto | active | inactive | disabled 
     取值:auto  :  默认值。不影响IME的状态。与不指定 ime-mode 属性时相同 
    active  :  指定所有使用IME输入的字符。即激活本地语言输入法。用户仍可以撤销激活IME 
    inactive  :  指定所有不使用IME输入的字符。即激活非本地语言。用户仍可以撤销激活IME 
    disabled  :  完全禁用IME。对于有焦点的控件(如输入框),用户不可以激活IME  说明:设置或检索是否允许用户激活输入中文,韩文,日文等的输入法(IME)状态。
    此属性对于 currentStyle 对象而言是只读的。对于其他对象而言是可读写的。对应的脚本特性为 imeMode 。 示例:禁用输入法:<input type="text" style="ime-mode: disabled" /> 
      

  2.   


    试试这个,放到onFocus中激发
    <INPUT onfocus=" this.style.imeMode='active' " /><INPUT onfocus=" this.style.imeMode='inactive' " /><INPUT onfocus=" this.style.imeMode='auto' " /><INPUT onfocus=" this.style.imeMode='disabled' " /> active 代表输入法为中文inactive 代表输入法为英文auto 代表打开输入法 (默认)disable 代表关闭输入法
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
     </HEAD>
     <BODY>
     <form method="post"> <input id='t1' onfocus="this.style.imeMode='active'"/> 
     </form>
     </BODY>
    </HTML>
    是这么写吗?