日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

js判断fck编辑器内容是否为空并获得焦点

發布時間:2024/9/20 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 js判断fck编辑器内容是否为空并获得焦点 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.


?
01 <script type="text/javascript" language="javascript">
02 function confirm()
03 {
04 var textname=document.getElementById("ctl00_ContentPlaceHolder1_TxtName").value;
05 if(textname=="")
06 {
07 alert("您還是留個稱呼吧!");
08 document.getElementById("ctl00_ContentPlaceHolder1_TxtName").focus();
09 return false;
10 }
11 return getContentValue();
12 }
13 function getContentValue()
14 {
15 var oEditor =FCKeditorAPI.GetInstance("ctl00_ContentPlaceHolder1_FCKeditor1");
16 var Content=oEditor.GetXHTML();
17 if(Content=="")
18 {
19 alert("您還沒有寫留言哦!");
20 oEditor.Focus();//獲取焦點
21 return false;
22 }
23 }
24 </script>

注意:

其中的"ctl00_ContentPlaceHolder1_FCKeditor1"是生成的靜態頁面中的FCK的實例名稱

src="/Web/fckeditor/editor/fckeditor.html?InstanceName=ctl00_ContentPlaceHolder1_FCKeditor1&amp;

1 <td style="vertical-align:top; text-align:right;">留言內容:</td><td><div><input type="hidden" id="ctl00_ContentPlaceHolder1_FCKeditor1" name="ctl00$ContentPlaceHolder1$FCKeditor1" value="" /><input type="hidden" id="ctl00_ContentPlaceHolder1_FCKeditor1___Config" value="HtmlEncodeOutput=true" /><iframe id="ctl00_ContentPlaceHolder1_FCKeditor1___Frame" src="/Web/fckeditor/editor/fckeditor.html?InstanceName=ctl00_ContentPlaceHolder1_FCKeditor1&amp;Toolbar=Standard" width="90%" height="150px" frameborder="no" scrolling="no"></iframe></div></td>

轉載于:https://www.cnblogs.com/jianfangkk/archive/2008/12/10/1367162.html

總結

以上是生活随笔為你收集整理的js判断fck编辑器内容是否为空并获得焦点的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。