一般的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>
.....
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>
.....
解决方案 »
- win7下使用UrlDownloadToFile无法保存文件??
- 我的table有一备注型字段,我现在能在Dbrid中显示这字段,但是不能在Dbgrid上编辑,如何才能编辑该字段?
- 求助:声明函数后,用什么快捷键可以让系统自动创建一个函数体?
- 求助彩票思路编程!
- 各位好,和各位讨论一个问题:
- 在TTreeview用什么函数判断它的根节点?
- 三层结构中主从表更新的问题
- 如何将一个图片进行左右转一定的度数?
- 怎么引用REMOTEDATAMODUAL上的控件?(如ADOCONNECTION)
- DELPHI如何调用中兴无线宽带上网卡(USB)的驱动程序做拨号和断开?
- 做数据库系统时出现问题
- 遍历窗体中子控件的句柄,其中如果是组合控件的话,要遍历出该组合控件内子控件的句柄。
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ä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;
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;
看看有用不?!