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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:24:16+00:00 2026-05-23T14:24:16+00:00

I have a ascx file in which i am using text box with tinyMCE

  • 0

I have a ascx file in which i am using text box with tinyMCE editor. code is following..

<asp:TextBox ID="txbDiag" TextMode="MultiLine" runat="server" Width="100%" Height="100px"/>
<acr3s:tinymceextender runat="server" ID="TinyMceExtender4" TargetControlID="txbDiag" Theme="Full"/>

like this i have using 5 text box with tinyMCE extender

I am trying to validate my textbox with spacebar, If someone open my page and in text box click on spacebar and click on btn save it should not accept the value and give the error field should not be empty. the code which i use to validate is

if (txbDiag.Text.Trim().Length <= 0)
{
   msgError.Text =  "<b><font Color=red>*" + "fields are mandatory"+"</font>";
   msgError.Focus();
   return false;
}

and on btn click i use

txbDiag.Text.Trim();

but while clicking on btn save page is getting saved.

i used the js

<script type="text/javascript">
   function validate(e) {
    var unicode = e.charCode ? e.charCode : e.keyCode;

    if (unicode == 32) {
        return false;
    }
    else {
        return true;
    }
}
</script>

but this is also not working

I used regular expression and requir field validation that also not causing validation

HOW COULD I VALIDATE MY TEXT BOX FROM SPACEBAR HELP ME????

  • 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-23T14:24:17+00:00Added an answer on May 23, 2026 at 2:24 pm
    if (Textbox1.Text.Replace("&nbsp;", "").Replace("<br />", "").Trim().Length <= 0)
    {
        //Statement here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp:FormView on a control (in an ascx file) which is loaded
I have an ASP.NET user control (.ascx file). In this user control I want
I am working on ASP.NET MVC3. I have a partial view RestaurantAdminNavigation.ascx which i
I am using an ASP.Net Web Application project. I have a user control which
I have a UserControl which rather than putting tags into its ascx markup file,
Asp.net A.aspx I'm using JQuery to access an ashx file which loads control (
I have a file called TopicTree.ascx.cs which I am trying to output encoded strings
Background I have a User Control (an .ascx file) which is being dynamically inserting
I have two .ascx files in the same folder in an ASP.NET MVC project.
In a particular page i have a ascx control which contains a table. Now

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.