就是这样的一个文本框
网页留言板的代码看下面,我现在就想把DELPHI中EDIT控件的值写到网页的这个框中,大家帮帮忙吧,我折腾了好久了.成功后再加50分.
如果下面代码不明白,可以去http://www.yy365.com这个网站注册个用户,给好友留言就知道了.
<!--留言板--><a name=a_comment></a>
<div class="liuyan" >
<div class="liuyan_01" id="box1">
<div class="top">
<div class="top_left" id="commentTitle"> 马桂兰的留言板 </div><div class="top_left" id="replyTitle"> </div>
</div>
<div id="showtext" style="display:none">
<div class="mini_pl_text">
<div style="margin-left:5px;" id="content_div" name="content_div" ></div>
comment_editor = new webEditor("comment_editor" , $("content_div") , 578, 100);
comment_editor.init("");
</script>
</div>
<div class="liuyan_end">
<input class="btn" id="btnSaveWords" type="button" name="Submit" value="留言" onclick="commitWords();"/>
</div>
</div>
</div>
<div class="pro_e" style="display:none;" id="resultInfo"></div>
<!--留言列表-->
div class="liuyan_02" >
<div class="top_01">
<div class="top_left" style="float:left" >
<span id="total"></span>
<a href="javascript:comment_editor.getFocus();">发布新留言</a>
</div>
<div class="top_right" id="topbar" style="width:300px;"> </div>
</div>
<div id="wordswall">
</div>
<div class="top_02" >
<div class="top_left" > </div>
<div class="top_right" id="bottombar" style="width:400px;" > </div>
</div></div></div>
</div>
<script>
var request = null;
var su = SigmaUtil;
window.onload = function(){
request = new SigmaRequest();
showGuestWords();
document.getElementById("showtext").style.display="";
} function showGuestWords(index,size){
request.open("post","guestwords!list.do",true);
if(index!=null){
request.setParameter("pageIndex",index);
}
if(size!=null){
request.setParameter("pageSize",size);
}else{
request.setParameter("pageSize",30);
}
request.setParameter("owner",316683);
request.onresult = function(){
var v = request.getValue(); if(v.exception == null){
showPage(v.page);
su.$("total").innerHTML ="共有"+ v.page.total+"条留言";
var p = v.page;
var s = createPageBar2(p.pageNumber,p.pageSize,p.pageIndex,'javascript:showGuestWords',5);
su.$("topbar").innerHTML = s;
su.$('bottombar').innerHTML = s;
}else{
alert(v.exception);
}
}
request.send();
} function commitWords(){
if (replyToId>0){
var title = "<span style='color:gray;'>回复 "+replyTo+":</span><br>";
replyToId=-1;
}else{
title ="";
}
var words = comment_editor.getHtml();
words = words.trim();
if(words==""){
showInfo("resultInfo","留言内容不能为空!",true);
toEnable("btnSaveWords");
return ;
}
if(words.length>300){
showInfo("resultInfo","留言字数不能超过300",true);
toEnable("btnSaveWords");
return;
}
request.open("post","guestwords!save.do",false);
request.setParameter("words",title+words);
request.setParameter("owner",316683);
request.setParameter("replyTo",replyToId);
request.onresult=function(){
var v = request.getValue();
if(v.exception==null){
showGuestWords();
comment_editor.setContent('');
}else{
alert(v.exception);
}
showInfo("resultInfo","保存留言成功!",true);
toEnable("btnSaveWords");
su.$("btnSaveWords").value="留言";
su.$("commentTitle").style.display = "block";
su.$("replyTitle").style.display = "none";
}
request.send();
} function deleteWords(id){
ShowMsgo.show("删除留言","确认要删除这条留言吗?",300,120);
ShowMsgo.ok_callback=function(){deleteWds(id);}
}
function deleteWds(id)
{
request.open("post","guestwords!delete.do",false);
request.setParameter("id",id);
request.onresult = function(){
var v = request.getValue();
if(v.exception==null){
showGuestWords();
}else{
alert(v.exception);
}
}
request.send();
} var replyTo ="";
var replyToId = -1;
function replyGuest(guest,guestId){
replyTo = guest;
replyToId = guestId;
su.$("commentTitle").style.display = "none";
su.$("replyTitle").style.display = "block";
su.$("replyTitle").innerHTML = "回复 "+guest;
su.$("btnSaveWords").value="回复";
window.location.href="#a_comment";
comment_editor.getFocus();
} function showPage(p){
var box = su.$("wordswall");
var elements = p.elements;
var sb = [];
var visitorId = 142962;
for(var i=0;i<elements.length;i++){
var one = elements[i];
var starstr='<a href="popularity!star.do">'+getStarStr(one.author.starLevel)+'</a>';
sb.push('<table width="590" border="0" cellspacing="0" cellpadding="0" class="mini_nr_list">');
sb.push(' <tr>');
sb.push('<td width="60" rowspan="2" align="center" valign="top"><a href="home!other.do?id='+one.author.id+'"><img src="'+one.author.photo_3+'"/></a> </td>');
sb.push('<td width="530" class="list_top"><div class="list_top_l"><a href="home!other.do?id='+one.author.id+'">'+one.author.name+'</a>'+starstr+'<span>('+one.author.city+') '+one.timeStr+'</span> </div>');
sb.push('<div class="list_top_r"> ');
if(visitorId==316683){
if(visitorId!=one.author.id)
sb.push('<a href="javascript:replyGuest(\''+one.author.name+'\','+one.author.id+');">回复</a>|');
sb.push('<a href="javascript:deleteWords('+one.id+');">删除</a> </div></td>');
}
sb.push(' </tr><tr>');
sb.push('<td width="530"><p>'+ubbToHtml(one.words)+'</p></td>');
sb.push(' </tr>');
sb.push('</table>');
}
box.innerHTML = sb.join("");
} function modifyIntro() {
var introdata = document.getElementById("introinfo").innerHTML;
var texta = document.getElementById("infoedit");
var t = texta.value;
if (t.length>200){
t = t.substring(0, 200);
texta.value=t;
}
if(t == introdata) {
document.getElementById("user_zt").style.display = "none";
return;
}
request.open("post","profile!updateIntro.do",false);
request.setParameter("intro",t);
request.onresult = function(){
document.getElementById("introinfo").innerHTML = t;
document.getElementById("introtime").innerHTML = "1秒钟前更新";
document.getElementById("user_zt").style.display = "none";
}
request.send();
} </script>
</div>
<!--留言板结束-->
解决方案 »
- 怎么让软件忽略指定异常
- 请教:菜单中没有使用权限的设为Enabled:=False; ,如何使鼠标移到此菜单上显示为:'你没有使用此功能的权限'的提示?
- 请问怎么检测一个程序的子窗体是否显示?
- 用Insert语句如何往Sql Server数据库中添加Image字段?
- 用dephi6和ado处理access数据库出现问题
- 用API怎么实现截获窗体最小化消息,并响应?
- 因为高兴,所以散分!
- ClientDataSet的巨难问题,有胆的就进来看看!!!!!!
- 我编的Echo程序为什么总是连接主机超时?
- 谁有windows help designer的注册机。
- 数据库软件如何实现网络访问数据?
- 我是编程初学者(以前没有其它语言的经验),各位高手推荐几部Delphi的好书,和学习方法!
楼主这些代码是网页代码吗?
function showGuestWords(index,size){
request.open("post","guestwords!list.do",true);
if(index!=null){
request.setParameter("pageIndex",index);
}
if(size!=null){
request.setParameter("pageSize",size);
}else{
request.setParameter("pageSize",30);
}
request.setParameter("owner",316683);
request.onresult = function(){
var v = request.getValue();