1.用WebBrowser控件怎么自动填写textarea的内容?
 doc:=webbrowser1.document as IHTMLDocument2;
 userinputelement:=(doc.all.item('u',0) as ihtmlinputelement);
 其中的u就是textarea的name
 我要往textarea写东西怎么弄?
 userinputelement.value:='XX'这样是不对的.2.如果一个submit键name="",且有很多个submit健name=""
  点击不同的submit健执行不同的js来提交东西的
<input type="button" name="" value="历史" class="btnStyle" onclick="showHistory('9876    ')">
<input type="button" name="" value="保存" class="btnStyle" onclick="save_plan()">
<input type="button" name="" value="完成" class="btnStyle" onclick="finish_plan()">
这样的话我怎么自动点击指定的按钮?

解决方案 »

  1.   

    1、试试这种方式:(((WebBrowser1.Document as IHTMLDocument2).body.all as IHTMLElementCollection).item('u', 0) as IHTMLInputElement).value:='XX'
    2、直接调用其函数就可以了,如:WebBrowser1.OleObject.Document.form1.showHistory('9876    ');
      

  2.   

    1、试试这种方式:(((WebBrowser1.Document as IHTMLDocument2).body.all as IHTMLElementCollection).item('u', 0) as IHTMLInputElement).value:='XX'
    这个和我的方法没什么区别吧?
    我只是分开了写
    要自动填写
    <textarea></textarea>中的值
    和普通的input是有点差别的.
    请教高手