onchange:
ResThis event is fired when the contents are committed and not while the value is changing. For example, on a text box, this event is not fired while the user is typing, but rather when the user commits the change by leaving the text box that has focus. In addition, this event is executed before the code specified by onblur when the control is also losing the focus. The onchange event does not fire when the selected option of the select object is changed programatically.上面最后一句说明用程序更改text的value,onchange()这个事件是不会触发的。

解决方案 »

  1.   

    用onpropertychange这个事件可以达到楼主的要求。
      

  2.   

    onchinage 难道不是?
    不过也不一定要确定软件内定的事件 自己写一个新的或象这样
    <script>
    function aa(){
    if (document.form1.text1.value!="aaa"){
        ....................                   //则表里面的值已经改变而执行另外的事情
                                           }
    else{
       .....................
        }
                 }
    </script>
    <body>
    <form name="form1" action="*.asp" onfocus="aa()">
    <input type="text" name="text1">
    </from>
    </body>
      

  3.   

    ***********上面的不完整onchinage 难道不是?
    不过也不一定要确定软件内定的事件 自己写一个新的或象这样
    <script>
    function aa(){
    if (document.form1.text1.value!="aaa"){   //确定text里面的值是否改变
        ....................                   //则表里面的值已经改变而执行另外的事情
                                           }
    else{
       .....................
        }
                 }
    </script>
    <body>
    <form name="form1" action="*.asp" onfocus="aa()">
    <input type="text" name="text1" value="aaa">
    </from>
    </body>
      

  4.   

    <input type='text' readonly='true' value='ggg' 
        onfocus='if(this.value="ggg")this.value="fff"'>