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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:46:40+00:00 2026-06-09T05:46:40+00:00

I am trying to slide down content within a div tag (red rectangle) when

  • 0

I am trying to slide down content within a div tag (red rectangle) when a user enters atleast one character in a textbox (green rectangle).

If no character is entered then the div content does not show.

Here is a pic of the aspx (design):

enter image description here

And this is the JavaScript I am using to try and achieve this:

function() {
    $("#SubmitSection").hide();
    inputOne = document.getElementById("<%= TextBox1.ClientID %>");
    if (inputOne.value != "") {
        $("#SubmitSection").slideDown('slow');
    }
    else {
        $("#SubmitSection").slideUp('slow');
    }
}​

All the backend code works just fine but both the textbox and the div section show up when deployed.

  • 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-09T05:46:42+00:00Added an answer on June 9, 2026 at 5:46 am

    You have to hook up to an event on the textbox. The onchange event only fires after the textbox loses focus, so I suggest the onkeyup event.

    <asp:TextBox ID="TextBox1" runat="server" [...] onkeyup="updateSubmitSection()" />
    

    You will have to name your function so that you can call it:

    updateSubmitSection = function() {
       $("#SubmitSection").hide();
      inputOne = document.getElementById("<%= TextBox1.ClientID %>");
      // ...
    }
    

    In addition to that, you need to call the function during the onload event of the page:

    <body onload='updateSubmitSection()'>
    

    The same solution using jQuery:

    $(document).ready(function() {
        updateSubmitSection();
        $('#<%= TextBox1.ClientID %>').change(updateSubmitQuery);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to slide down a div after the Show link is clicked and
I'm trying to figure out how to make jQuery slide #content2 down and replace
I am trying to make a div slide to a FIXED position on the
I'm trying to put two divs on the right side of parent div one
I'm trying to do a proper slide-down animation. The view that slides down should
I'm trying to do hover over bottom bar, which will slide in another div
I am trying to make a <ul> slide down using CSS transitions. The <ul>
I'm trying to figure out how to slide content off the bottom of the
I'm trying to find/make a good jquery drop-down menu with animation (fadein/fadeout or slidedown)
I'm developing smartphone hybrid applications. I'm trying to hide/show a <div> with slideDown /

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.