---
title: "在线编辑器的内容插入数据库的问题"
author: "xiaomogui"
date: "2008-05-24T13:25:33Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2008-05-24T13:25:33Z"
id: 196350
url: "https://xiaomogui.iteye.com/blog/196350"
---

<head>
<script language="javascript">
function subchk()
{
    document.<span style="color:red">questionAction</span>.content.value= window.eWebEditor1.getPureHtml();
}
</script>
下面的是一个表单；
<s:form action="insertquestion" method="post" <span style="color:red">name="questionAction"</span>
			 <span style="color:blue">onsubmit="subchk()"</span>>

  内容：<textarea name="content" style="display:none"></textarea>
<IFRAME ID="eWebEditor1" <span style="color:darkred">src="ques/edit
.html"</span> frameborder="0"
		scrolling="no" width="467" height="200"></IFRAME>

</s:form>

今天又犯了一个错误！！上面的是我用struts2+spring2.0+hibernate3.0做的一个小项目中在页面中嵌入了一个编辑器，刚开始我怎么也不能把content中的内容写到数据库！！每次插入数据库中的内容都是null；哈哈。。
仔细查找了一下。。原来在form表单中没有加<span style="color:blue">onsubmit="subchk()"</span>。。真是晕死了！！还有form表单中的<span style="color:red">name="questionAction"</span>
要和function subchk()
{
    document.<span style="color:red">questionAction</span>.content.value= window.eWebEditor1.getPureHtml();
}
</script>中的<span style="color:red">questionAction[/color一致。起什么名字都可以，