用js
<script language = javescript>
function get_content()
{
document.form1.content.value=window.test.gethtml();
}
</script>
<form name = form1 mothed=post onSubmit="get_content()">
<input type=hidden name=content>
:<iframe src="about:blank" id="test" frameborder=no width=556 height=200 border=0 MARGINWIDTH=0 MARGINHEIGHT=0 name=Editor></iframe>
</form>
<script language = javescript>
function get_content()
{
document.form1.content.value=window.test.gethtml();
}
</script>
<form name = form1 mothed=post onSubmit="get_content()">
<input type=hidden name=content>
:<iframe src="about:blank" id="test" frameborder=no width=556 height=200 border=0 MARGINWIDTH=0 MARGINHEIGHT=0 name=Editor></iframe>
</form>
要改成新闻发布系统,至少要修改下面两个东西:
1、将<INPUT onclick="SendMailPro(); return false;" type=submit value=发布新闻 name=send>中的type改为button,通过执行SendMailPro()来检查发布新闻的合法性,然后再提交表单。1、SendMailPro
在原来的函数中有以下几行: var tovStr = document.ComposeForm.titles.value
var ccStr = document.ComposeForm.cc.value
var bccStr = document.ComposeForm.bcc.value
这些在原来邮件系统中分别是提取表单中发件人转发人等的信息,但是现在的表单中已经没有了,而取而代之的是titles的信息,所以执行此函数的时候会报“缺少对象”的错误。试试将SendMailPro()改为下面代码function SendMailPro()
{
var titlesStr = document.ComposeForm.titles.value
if (titlesStr == "")
{
alert("请填写新闻标题。");
}
else
{
document.ComposeForm.msgtxt.value = Editor.document.body.innerHTML;
if (document.ComposeForm.msgtxt.value==""){
alert("请填写新闻正文。");
}
else
{
document.ComposeForm.submit();
}
}
}