fckeditor textarea in JSP in judging the issue is not empty

Using FckEditor, which require the judge textarea is empty, but found directly through the DOM to determine where the node is not empty textarea is not feasible to search a bit online only to find that many people are experiencing this problem, but the Internet answers did not directly solve the problem. After trying the following method is feasible.
Try that, applied FckEditor the textarea, if not to fill out textarea anything in the submission form, visit the textarea's value by JS property, its value is not empty. By GetXHTML () method that, when the textarea is not reclaimed within the content, when the form is submitted, textarea of the value of the value of "<br />", You Ran out of this solution, the following key code:

var content=FCKeditorAPI.GetInstance("content").GetXHTML();
if(content==""||content=="<br />"){
    alert(" Please fill in the content  !");
    return false;
分类:Web 时间:2010-03-30 人气:321
blog comments powered by Disqus


  • FCKEditor to use. Modify the source code Experience 2010-12-30

    FCKEditor to use, modify the source code Experience Of: Liu Yan Email: suhuanzheng7784877@163.com Introduction: Ado, engaged in a web developer who probably know FCKeditor is used as online HTML editor, similar to the word of the editors tried to sho

  • Cross-domain form submission form and transcoding (GBK → UTF-8) 2010-03-10

    A website under the domain encoding format is GBK www.A.com submit a query message: Search XXX Web page under the B domain encoding format is UTF-8 www.B.com in Foreign there search.do A domain in the form submitted under the form POST to the B domain of

  • JSP comments in the browser view the source code, do not see this interface 2010-12-29

    JSP comments in the browser view the source code, do not see this interface <% - Do not see me, and I was commented code -%> <% - / * * Copyright (c) 2007, Sun Microsystems, Inc. All rights reserved. * * Redistribution and use in source and

  • The jsp uses FCKeditor 2.6.6 2010-12-28

    Ado, are my own build steps, for reference only 1. Download FCKeditor_2.6.6.zip, fckeditor-java-2.6-bin.zip, fckeditor-java-2.6-src.zip (To modify the source code), fckeditor-java-demo-2.6.war. 2. WebRoot under the FCKeditor_2.6.6.zip extract; the co

  • jsp called fckeditor 2010-03-29

    <% @ Taglib uri = " http://java.fckeditor.net "Prefix =" FCK "%> <FCK: editor toolbarSet = "wang" width = "100%" height = "250pt" basePath = "FCKeditor /"> </ FCK: editor> js co

  • solve the repeated submission form struts 2010-12-29

    Application scenarios: from the page to insert data into the database, such as user registration, submission of a message and so on, when the operation is successful, then click the "Back" button to return to the form page to submit the form aga

  • On the server side to judge whether the repeated submission form 2010-04-20

    Zai server-side to judge whether the duplicate form submission, mainly between pages can be considered through the Session Gongxiang flag variable used to realize, that the client signs in Page Setup Session variables, then the server flags section of pai

  • jQuery Form Plugin: AJAX submission form complete programs 2011-01-08

    Translated: http://www.malsup.com/jquery/form/ Introduction jQuery Form Plugin can be easily and implicitly to improve the HTML form using AJAX (Form). The main function ajaxForm and ajaxSubmit collect information from the form element and then decide how

  • jsp file upload control to achieve the application code examples 2011-04-30

    html <html> <head> <title> uploading files </ title> </ Head> <body> <form action="basic.jsp Tutorial " method="post"> <input type="file" name="filer"> <br>

  • input text default mouse event textarea default mouse event code 2010-05-11

    input default is empty, automatically display the default, non-empty, display the user's input. textarea, too, can. Automatically clears the default value of form input fields script, that when users click on the input focus when the input field, ...

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.220 (s). 12 q(s)