ASP中的部份代码如下(无表单):
<BODY>
........
<INPUT class=txt1 onblur=on_Blur(this) 
            title=请输入.... 
            style="WIDTH: 120px; HEIGHT: 19px; BACKGROUND-COLOR: #428cd3" 
            onfocus=on_Focus(this) maxLength=12 name=User_select_endX> 
<INPUT class=txt1 onblur=on_Blur(this) 
            title=请在此处输入...
            style="WIDTH: 120px; HEIGHT: 19px; BACKGROUND-COLOR: #428cd3" 
            onfocus=on_Focus(this) type=password maxLength=12 name=edPwdX>
<INPUT onclick=Validate(this); type=image height=35 width=37 
            src="01_r9_c5.jpg" border=0 me=Submitgo>
........
</BODY>
用下列语句自动填入数据:
webbrowser1.OleObject.Document.body.User_select_endX.value:='123';
webbrowser1.OleObject.Document.body.edPwdX.value:='123';
时报错:
project project1.exe raised exception class EoleError with message 'Method' User_select_endX' not supported by automation object'.
请问大侠应如何处理,填入数据后如何让其自动点击指定的按钮或执行<script>过程?

解决方案 »

  1.   

    of course you are wrong
    在没有表单的时候你应该把你的语言改成这样
    webbrowser1.OleObject.Document.all['edPwdX'].value:='123';才对
    而下面的这个对象
    webbrowser1.OleObject.Document.body.edPwdX
    是不存在的你在asp页面下加一句语句就知道了
    alert(webbrowser1.OleObject.Document.body.edPwdX)
    出现null
      

  2.   

    相关的内容与窗体有关,你可以去看看javascript dom方面的知识
    虽然是asp页面但是你的对象是在客户端创建的对象你的delphi程序也是在客户端输入数据的所以你还是要去看看html的窗体对象的关系
      

  3.   

    我的上上面错了应该是alert(document.body.edPwdX);
      

  4.   

    多谢帮忙,按你的提示将
    webbrowser1.OleObject.Document.body.edPwdX.value:='123';
    改为
    webbrowser1.OleObject.Document.all['edPwdX'].value:='123';
    运行到此语句时报错:
    project project1.exe raised exception class EoleError with message 'Method' value' not supported by automation object'.
    请再帮忙指点。