经过在网上一翻查找和自己的一些想法。总算是可以骓FreeTextBox里面的值是否为空了。
现在说明如下。
先解释一下。freeTxetBox在页面上生成以后。会出现一个iframe ,你所写的内容都写在了这个iframe里面。所以只要取得这个iframe 里面的内容就行了。不过这个iframe 的ID号会比你所定义写的freeTextBox 的ID号多一点点东西。 就是”__editor”,
如果你FreeTextBox 的ID号为txt_contect,那么。这个iframe 的ID号就是txt_contect__editor了。
一部分代码贴出来。大家可以试试。
<tr>
<td class="ttd" style="width: 175px; height: 387px; vertical-align: top;">
内容:</td>
<td class="ttd" style="width: 600px; height: 387px;">
<FTB:FreeTextBox ID="txt_contect" runat="server" Height="500px" ImageGalleryPath="upimages" Width="600px">
</FTB:FreeTextBox>
</td>
</tr>
<script type="text/javascript">
function showtext()
{
var val= window.frames["txt_contect_editor"].document.body.innerHTML;
alert(val);
}
</script>
<input type="button" onclick="showtext()" value="内容" />