一般的text的form,checkbox的form都可以提交
var
  WForm : IHTMLFormElement  ;
  D : IHTMLDocument2  ;
begin
   with EmbeddedWB1 do         
    D := Document as IHTMLDocument2;
    WForm := D.Forms.item('Form1',0) as IHTMLFormElement;   (WForm.item('myfield',0) as IHTMLElement).setAttribute('value','2',0);
    WForm.submit;
end:
但是碰到radio的form怎么办啊?我怎么试都不行,都是没有选择到具体的空提交。
各位老大有没有什么例子,帮帮我吧这个是我想要提交的网页部分代码
<FORM METHOD="POST" ACTION="aaa.htm" NAME="form1">
<INPUT TYPE="hidden" NAME="owner" VALUE="7000">
<INPUT TYPE="hidden" NAME="item" VALUE="3,1">
<INPUT TYPE="hidden" NAME="status" VALUE="1,5">
<table border="3" cellspacing="2" cellpadding="5" width="550" BGCOLOR="#FFFFFF" BORDERCOLOR="#999999">
<tr>
<td align="center" nowrap>名字</td>
<td width="64" align="center" nowrap>名字</td>
<td align="center" nowrap>名字</td>
<td align="center" nowrap>名字</td>
<td align="center" nowrap>名字</td>
<td align="center" nowrap>名字</td>
<td align="center" nowrap>名字</td>
</tr>
<tr>
<td align="center">
                     <input type="radio" name="myitem_number" value="1"></td>
<td align="center">物品</td>
<td align="left">物品</td>
<td align="center" nowrap>物</td>
<td align="right" nowrap>1111</td>
.....

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
      Document: IHTMLDocument2;
      rbTestList: IHTMLElementCollection;
      rbTest: IHTMLOptionButtonElement;
      I: Integer;
    begin  Document := WebBrowser1.Document as IHTMLDocument2;  rbTestList := Document.all.item('rating', EmptyParam) as IHTMLElementCollection;
      for I := 0 to rbTestList.Length - 1 do
      begin    rbTest := rbTestList.item(I, EmptyParam) as IHTMLOptionButtonElement;    if rbTest.Checked then
          ShowMessageFmt('Der RadioButton mit dem Wert %s' +
            ' ist ausgew&auml;hlt!', [rbTest.Value]);
      end;
      for I := 0 to rbTestList.Length - 1 do
      begin    rbTest := rbTestList.item(I, EmptyParam) as IHTMLOptionButtonElement;    if rbTest.Value = '3' then
          rbTest.Checked := True;
      end;
    end;
      

  2.   

    如果像楼主所说,应该是delphi的bug。
      

  3.   

    procedure TClientHandleThread.HandleInput2;
    var
      doc: IHTMLDocument2;
      Items: IHTMLElementCollection;
      aItem: IHTMLInputElement;
    begin
      doc := MainForm.wb.Document as IHTMLDocument2;
      Items := doc.all;  if Items.Item('msg', EmptyParam).QueryInterface(IID_IHTMLInputElement, aItem) = S_OK then
      begin
        aItem.Value := 'byebye';
      end;
      if Items.Item('B1', EmptyParam).QueryInterface(IID_IHTMLInputElement, aItem) = S_OK then
      begin
        aItem.form.submit;
      end;end;
    看看有用不?!