Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Once we click the button then it show the some extended labels and the same as we click the same button the extended lable are hide/Invisable.

Suggest how to design.
Posted
Updated 5-Feb-12 19:43pm
v2
Comments
That's Aragon 6-Feb-12 1:44am    
Edited for grammar and readability.

use below script
on buttonClientClick
JavaScript
document.getElementById('<%=yourlabelID.ClientID%>').style.display=document.getElementById('<%=yourlabelID.ClientID%>').style.display==''?'none':'';
 
Share this answer
 
Comments
Tech Code Freak 6-Feb-12 6:27am    
5up!
Hi,

You can write something like this...
HTML
<html>>
<head>
	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script type="text/javascript">
	$(document).ready(function(){	
		
		$('#toggleDiv').click(function(){
			$('#MyDiv').toggle();
		});
		
	});
	</script>

</head>
<body>
	
	<input type="button" id="toggleDiv" value="Toggle Div With TextBox">
	<br />
	<br />
	<div id="MyDiv">
		<input type="text" name="MyTextBox" value="TextBox 1" />
	</div>

</body>
</html>
 
Share this answer
 
Comments
Tech Code Freak 6-Feb-12 6:27am    
5up!
XML
<html>>
<head>
    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){

        $('#toggleDiv').click(function(){
            $('#MyDiv').toggle();
        });

    });
    </script>

</head>
<body>

    <input type="button" id="toggleDiv" value="Toggle Div With TextBox">
    <br />
    <br />
    <div id="MyDiv">
        <input type="text" name="MyTextBox" value="TextBox 1" />
    </div>

</body>
</html>
 
Share this answer
 
Comments
Tech Code Freak 6-Feb-12 6:27am    
5up!
JavaScript
function hide(){
document.getElementById('controlID').style.visibility='hidden';
}
function show(){
document.getElementById('controlID').style.visibility='visible';
}
 
Share this answer
 
v2
Comments
Anuja Pawar Indore 6-Feb-12 3:00am    
Added pre tag
Tech Code Freak 6-Feb-12 6:27am    
5up!

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