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 7633867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:00:26+00:00 2026-05-31T07:00:26+00:00

on a ascx page I have a tinymce editor and a button <asp:TextBox ID=txtName

  • 0

on a ascx page I have a tinymce editor and a button

<asp:TextBox ID="txtName" runat="server" Width="100%" ></asp:TextBox>
<test:tinymceextender runat="server" ID="TinyMceExtender" TargetControlID="txtName" Theme="Full"> </test:tinymceextender>

<asp:Button ID="btnSave" Text="Save" Enabled="false" runat="server" />

I want to check if, textbox is null, then btnsave should be disable, if textbox is not null its should be enable, for the first time its working(because i am checking it on Page_Load), as I am entering some text and deleting that text using backspace btn is in enable mode only. I tried it to do with onKeyUp, onKeyPress but its working working for TinyMCE

these 2 js I used but its not working

$(document).ready(function () {
    document.getElementById('<%=btnSave.ClientID %>').disabled = true;
    var my_editor = tinymce.get('<%=txtName.ClientID %>');
    if ($(my_editor.getBody()).text() == '') {
        $("#<%=btnSave.ClientID %>").attr('disabled', 'disabled');
    }
    else if ($(my_editor.getBody()).text() != '') {
        $("#<%=btnSave.ClientID %>").removeAttr('disabled');
    }
});

window.onload = function () {
    document.getElementById('<%=btnSave.ClientID %>').disabled = true;
}
function ENABLE_BTN() {
    var EN = tinymce.get('<%=txtName.ClientID %>');
    if (EN == '') {
        document.getElementById('<%=btnSave.ClientID %>').disabled = true;
    } else {
        document.getElementById('<%=btnSave.ClientID %>').disabled = false;
    }
}

calling onkeydown=”ENABLE_BTN() on txtName

on F12: my textbox code is looking something like this…

  <fieldset>

  <input id="BasePage_txtName" type="text" style="width: 100%; display: none;"  name="BasePage$txtName" aria-hidden="true">
  <span id="BasePage_txtName_parent" class="mceEditor defaultSkin" role="application" aria-labelledby="BasePage_txtName_voice">
  <span id="BasePage_txtName_voice" class="mceVoiceLabel" style="display:none;">Rich Text Area</span>
  <table id="BasePage_txtName_tbl" class="mceLayout" cellspacing="0" cellpadding="0" role="presentation" style="width: 100%; height: 100px;">
  <tbody>
  <tr class="mceFirst" role="presentation">
  <tr class="mceLast">
 </tbody>
   </table>
  </span>
  </fieldset>
  • 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-05-31T07:00:29+00:00Added an answer on May 31, 2026 at 7:00 am

    I would use the keyup event to check if the contents are empty like this. Edit: updated to use TinyMCE’s weird eventhandler methods.

    $(function () {
    
      tinyMCE.init({
        // adapt accordingly
        mode : "exact",
        theme : "simple",
        elements : "txtName", 
        setup : function(ed) {
                   ed.onInit.add(function(ed) {
                         bindKeyUp(ed);
               });}
                 });
    });
    
    function bindKeyUp(ed) {
     if (tinyMCE.activeEditor) {
        ed.onKeyUp.add(function() { 
          $('#btnSave').attr('disabled', !(textBoxEmpty()));
        });
     }
    }
    
    function textBoxEmpty() {
     var contentLength = tinyMCE.get('#txtName').getContent();
        if (contentLength.length) {
          return true;
        }
     return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two instances of an Address.ascx control in an ASP.NET MVC page. <h1>Shipping
I have a hidden filed <asp:HiddenField ID=hdnCFIV Value=0 runat=server /> I am changing the
I have many ascx control files in which I am using the tinymce editor
I have an ascx page which contains the following line: <%= Html.TextBox(DayOfWeek, Model.JourneyBooking.StartDate.DayOfWeek.ToString(), new
I have an .ascx control in my searchresults.aspx page: <asp:LinkButton id=LinkButton1 Text=Click Me Font-Names=Verdana
In a particular page i have a ascx control which contains a table. Now
I have a page containing a control called PhoneInfo.ascx. PhoneInfo is dynamically created using
I have a .aspx page that loads three separate .ascx controls to represent adding,
I have a view: User. In that I have an ascx page : Details
I am trying to edit a control which doesn't have an .ascx page, it

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.