• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

DelphiWebbrowser修改textarea值百度

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

有个按钮 调用  <a href="#" onclick="$.ajax({url: &#x27;/redmine/journals/edit/29606.js&#x27;, type: &#x27;get&#x27;}); return false;" title="编辑"><img alt="Edit" src="/redmine/images/edit.png?1409696303" /></a>

redmine/journals/edit/29606.js
$("#journal-29606-notes").hide();

if ($("form#journal-29606-form").length > 0) {
  // journal edit form already loaded
  $("#journal-29606-form").show();
} else {
  $("#journal-29606-notes").after('<form accept-charset=\"UTF-8\" action=\"/redmine/journals/edit/29606\" data-remote=\"true\" id=\"journal-29606-form\" method=\"post\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /><input name=\"authenticity_token\" type=\"hidden\" value=\"sydzG/YXRpUdgxZ6pyaAyq4gdxRHyScjXTE5BDKOK6w=\" /><\/div>\n    <label class=\"hidden-for-sighted\" for=\"notes\">批注<\/label>\n    <textarea class=\"wiki-edit\" id=\"journal_29606_notes\" name=\"notes\" rows=\"16\">\n43501 {&quot;STATE&quot;:200,&quot;DESC&quot;:&quot;执行成功&quot;,&quot;LIST&quot;:[{&quot;OPERATORNAME&quot;:&quot;运营商名&quot;,&quot;BREAKINGLINETIME&quot;:10.56,&quot;BREAKINGTIMES&quot;:1,&quot;BREAKINGLINERATE&quot;:1.5},{&quot;OPERATORNAME&quot;:&quot;ADCAP&quot;,&quot;BREAKINGLINETIME&quot;:1.0445,&quot;BREAKINGTIMES&quot;:123,&quot;BREAKINGLINERATE&quot;:0.55}],&quot;COUNT&quot;:2}43502 {&quot;STATE&quot;:200,&quot;DESC&quot;:&quot;执行成功&quot;,&quot;LIST&quot;:[{&quot;OPERATORNAME&quot;:&quot;WSDF&quot;,&quot;BREAKINGLINESTARTIME&quot;:&quot;2015-08-28 00:00:00&quot;,&quot;BREAKINGLINEENDTIME&quot;:&quot;2015-08-28 00:00:00&quot;,&quot;BREAKINGLINETIME&quot;:10.22},{&quot;OPERATORNAME&quot;:&quot;ASF是否&quot;,&quot;BREAKINGLINESTARTIME&quot;:&quot;2015-08-27 10:26:52&quot;,&quot;BREAKINGLINEENDTIME&quot;:&quot;2015-08-28 10:26:57&quot;,&quot;BREAKINGLINETIME&quot;:10.4}],&quot;COUNT&quot;:2}43503 {&quot;STATE&quot;:200,&quot;DESC&quot;:&quot;执行成功&quot;,&quot;LIST&quot;:[{&quot;STRATIVEID&quot;:123,&quot;OPERATORNAME&quot;:&quot;123&quot;},{&quot;STRATIVEID&quot;:123,&quot;OPERATORNAME&quot;:&quot;123&quot;},{&quot;STRATIVEID&quot;:123,&quot;OPERATORNAME&quot;:&quot;123&quot;},{&quot;STRATIVEID&quot;:123,&quot;OPERATORNAME&quot;:&quot;123&quot;},{&quot;STRATIVEID&quot;:123,&quot;OPERATORNAME&quot;:&quot;123&quot;}],&quot;COUNT&quot;:72}\n<\/textarea>\n    \n    <p><input name=\"commit\" type=\"submit\" value=\"保存\" />\n    <a accesskey=\"r\" href=\"#\" onclick=\"submitPreview(&quot;/redmine/issues/preview/edit/4635?project_id=industry&quot;, &quot;journal-29606-form&quot;, &quot;journal_29606_preview&quot;); return false;\">预览<\/a> |\n    <a href=\"#\" onclick=\"$(&#x27;#journal-29606-form&#x27;).remove(); $(&#x27;#journal-29606-notes&#x27;).show(); return false;\">取消<\/a><\/p>\n\n    <div id=\"journal_29606_preview\" class=\"wiki\"><\/div>\n<\/form><script type=\"text/javascript\">\n//<![CDATA[\nvar wikiToolbar = new jsToolBar(document.getElementById(\'journal_29606_notes\')); wikiToolbar.setHelpLink(\'/redmine/help/zh/wiki_syntax.html\'); wikiToolbar.draw();\n//]]>\n<\/script>\n');
View Code

 

暂时没法找到方法:

http://www.itnose.net/detail/456763.html

你属性设置错误:textarea不是设置InnerText,而是设置HtmlElement实例.SetAttribute("value","你的文本")   不行 估计是别的编程语言

 

2、也不行,提示说 接口没有实现

procedure TForm1.Button2Click(Sender: TObject);
var
Doc:IHTMLDocument2;
input:OleVariant;
TT:ihtmlinputelement;

begin
doc:=webbrowser1.document as ihtmldocument2;
tt:=(doc.all.item('chatInput',0) as ihtmlinputelement);
tt.value:=edit1.text;
end;

以下为可以操作的:

1、mmo1.Lines.Add(wb1.OleObject.Document.getElementByID('issue_description').innerText);   //journal-29606-notes

<textarea class="wiki-edit" cols="60" id="issue_description" name="issue[description]" rows="10">
要获取的内容</textarea>
<div class="wiki editable" id="journal-29606-notes"><div class="contextual"><a href="/redmine/issues/4635/quoted?journal_id=29606" data-method="post" data-remote="true" rel="nofollow" title="引用"><img alt="Comment" src="/redmine/images/comment.png?1409696303" /></a> <a href="#" onclick="$.ajax({url: &#x27;/redmine/journals/edit/29606.js&#x27;, type: &#x27;get&#x27;}); return false;" title="编辑"><img alt="Edit" src="/redmine/images/edit.png?1409696303" /></a></div><p>通过修改ID也可以获取这里面的内容</p></div>

 

2、http://www.cnblogs.com/jxsoft/archive/2011/07/18/2109127.html

解决了本人 修改编辑框里面的内容;

 给HtmlElement设置Value属性

procedure SetValueTextAreaName(web: TWebBrowser; elementName, value: string;index: integer);
begin
(((web.Document as IHTMLDocument2).body.all as
IHTMLElementCollection).item(elementName, index) as IHTMLTextAreaElement
).value := value;
end;

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi开发中增删改查操作以及存储过程的调用方式发布时间:2022-07-18
下一篇:
delphi获得当前鼠标坐标发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap