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):

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.
You have to hook up to an event on the textbox. The
onchangeevent only fires after the textbox loses focus, so I suggest theonkeyupevent.You will have to name your function so that you can call it:
In addition to that, you need to call the function during the
onloadevent of the page:The same solution using jQuery: