Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
How to hide a label using jquery?
and how to hide a asp:DropdownList using Jquery?
Posted 24-May-13 0:33am
Edited 24-May-13 0:34am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Use jQuery .hide()[^] function.
$('#lblId').hide(); // Replace the correct ID of Label.
$('#drpId').hide(); // Replace the correct ID of DropDown.
Comments
Sergey Alexandrovich Kryukov at 4-Jun-13 2:38am
   
5ed.
—SA
Tadit Dash at 4-Jun-13 3:07am
   
Thanks a lot Sergey Alexandrovich Kryukov... :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi Vasantha,
 
The following would do the work.
 
$('#labelID').hide();
$('#dropdownlistID').hide();
 
Please replace the labelID and dropdownlistId with the control IDs.
Other option is to make the css usage.
 
$('xxxxID').css('display', 'none');
 
Thank you,
Vamsi
  Permalink  
v2
Comments
Tadit Dash at 24-May-13 5:41am
   
It is not show(), it is hide() to hide any selected control.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

document.getElementById("<%=dropdowmcontrolID.ClientID%>").style.visibility = "visible";
document.getElementById("<%=labelid.ClientID%>").style.visibility = "visible";
 

 
document.getElementById("<%=dropdownid.ClientID%>").style.visibility = "hidden";
document.getElementById("<%=labelid.ClientID%>").style.visibility = "hidden";
 

 
this is working fine..
  Permalink  
Comments
Tadit Dash at 24-May-13 8:54am
   
Yes it will work fine. But as you said to do it using jQuery in your question, so I have posted one answer to use .hide function. It is very simple and easy.
 
Please accept "Solution 2" as answer.
This will help others to find the answer in one go and you will also be awarded with some points for this action...
Sergey Alexandrovich Kryukov at 4-Jun-13 2:41am
   
Tadish is right. You should accept his solution. And you should not post what you have here: first, you are "answering" your own question, which makes no sense (imagine how many fake posts could anyone do this way, some do, but who is interested to see it?), secondly, you are not really answering it the way you required by yourself.
—SA
Tadit Dash at 4-Jun-13 3:07am
   
Thanks... :)

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

  Print Answers RSS
0 Kornfeld Eliyahu Peter 169
1 Zoltán Zörgő 139
2 George Jonsson 135
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100