Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to show /hide textbox when i click button using asp.net C# using javascript.when i enter somthing after text box hide.For example,
 <br />
Was the product helpful? Yes/No <br />
<br />
Thanks for your vote!


how i do?
Posted
Updated 22-Feb-15 20:28pm
v2
Comments
King Fisher 23-Feb-15 2:37am    
what you have tried?

May this help you

for Hide
document.getElementById("<%=textbox.ClientID%>").style.display = 'none';

for Show
document.getElementById("<%=textbox.ClientID%>").style.display = '';
 
Share this answer
 
v3
In Below code ion button click textbox is visible then textbox hide or textbox hide the textbox is visible

HTML
<script src="Script/jquery-1.3.2.min.js" type="text/javascript"></script>


JavaScript
$('#<%=Button.ClientID%>').click(function () {
      if ($('#<%=Textbox1.ClientID%>').is(':visible')) {
          $('#<%=Textbox1.ClientID%>').Hide();
      }
      else {
          $('#<%=Textbox1.ClientID%>').show();
      }

  });
 
Share this answer
 
v3
Comments
King Fisher 23-Feb-15 2:41am    
I don't find any tag related to Jquery.
Tushar sangani 23-Feb-15 3:38am    
this is do in my application
King Fisher 23-Feb-15 4:03am    
but OP expecting in Javascript
Tushar sangani 23-Feb-15 5:00am    
to run above jquerry add java script library in code like below

<script src="Script/jquery-1.3.2.min.js" type="text/javascript"></script>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900