Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:29:57+00:00 2026-06-13T05:29:57+00:00

I have an HTMLEditor in my aspx file with id = txtText I am

  • 0

I have an HTMLEditor in my aspx file with id = “txtText”

I am trying to write a JQuery function which checks if the content of the editor is empty.

I originally had:

function check()
{
    if($('#txtText').val() == '')
    {
         return false;
    }
    return true
}

However when I added an alert box to find out why this doesn’t work. I realized that the .val() property of the HTMLEditor is always undefined (whether the editor has text or has no text).

I tried using $(‘#txtText’).content(), which is how I am accessing the data in the code-behind(C#), but that does not seem to work in JQUERY.

After doing some research I found this site: http://forums.asp.net/t/1549543.aspx/1

I have very smiliar code, such that I also made my own custom editor which inherits from the one in AJAXToolkitEditor.

<cc1:CustomEditor ID="txtEditor" Height="600px" runat="server" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:Button ID="Button1" OnClientClick="getImageContent()"
    runat="server" Text="Button" OnClick="saveContent" />
<asp:HiddenField ID="HiddenField1" runat="server" />

The posted code does not work for me:

function getImageContent() {
var editor = $find("txtEditor");
var editPanel = editor.get_editPanel();
var designPanel = editPanel.get_modePanels()[0];
var s = designPanel.get_content();

document.getElementById("HiddenField1").value = s;

}

The line var editor = $find(“txtEditor”) is a null value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:29:59+00:00Added an answer on June 13, 2026 at 5:29 am

    You’ll likely need to get the generated ClientID (something like ctl00_txtEditor) using a bit of server script (<%=txtEditor.ClientID%>)

    HTMLEditor:

    Sort hack-ish but this should determine if there is an content in an HTMLEditor control client-side (server-side is easy to check via txtEditor.Content)

    jQuery:

    $('#<%=txtEditor.ClientID%>').find('iframe').eq(2).contents().find('body').html()
    

    HTMLEditorExtender:

    This works for the HTMLEditorExtender which is recommended over using the HTMLEditor control

    Note: We recommend that you use the new HtmlEditorExtender instead of
    the HtmlEditor control described on this page. The HtmlEditorExtender
    takes advantage of HTML5 and works with IE6 and later.

    jQuery:

    $('#<%=txtEditor.ClientID%>').val()
    

    or JavaScript

    document.getElementById('<%=txtEditor.ClientID%>').value
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Drupal 6 website which is using FCK Editor as HTML editor. It
I have a python application which need a gui HTML editor, I know FCKeditor
I'd simply like not to have a JQuery based HTML editor that use <b>
I am creating a small HTML editor using jQuery. I have created my own
I have a function in .CS file. i want to return many values fetched
I have a HtmlEditor(ajax control) in which i am giving some contents to be
I use the HTML Editor from ASP.NET Ajax AjaxControlToolkit http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/HTMLEditor/HTMLEditor.aspx . Its like: http://s3.imgimg.de/uploads/2889172fdJPG.jpg
I have an html editor and I am trying to insert the html it
i have a div and an html editor and trying to: add the div
i'm creating a simple html editor with jquery. say i have this html: <div

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.