Click here to Skip to main content
15,894,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually in my item template i am taking checkbox and linkbutton i am binding userid to both the controls so i want to hide the text of the checkbox.so that i can display checkbox and link button with userid
Posted
Updated 31-May-13 0:44am
v3
Comments
ntitish 31-May-13 4:14am    
this is my cs code but it is not working

.hiddenText input[type="checkbox"] + label
{
display:none;
}
Can you please post the rendered html of the CheckBox or whole GridView from browser View Source.
ntitish 31-May-13 5:27am    
<asp:CheckBox ID="chk" Width="10px" runat="server" Text='<%# Eval("UserID") %>'
/>
ntitish 31-May-13 5:28am    
Sir sorry for late reply....
ntitish 31-May-13 5:37am    
sir the messages what u r sending to me is displaying lately..

1 solution

I have done the task for you using jQuery.

Take a look - [Demo] How to hide the text of asp.net check box in jQuery ?[^]
 
Share this answer
 
Comments
ntitish 31-May-13 6:52am    
sir not on click event sir....while loading itself i dont want to show the text of the checkbox
Ok. then just move the code inside button click to loading of the page.

like...

window.onload = function() {

$('input[type="checkbox"]').each(function(){
var selectedID = $(this).attr('id');
var value = $('label[for=' + selectedID + ']').text("");
});
};
ntitish 31-May-13 6:59am    
sir i not understand sir...if u dont mind can u explain clearly ...
Inside script tags, add the above code from window.onload to the last.

this function will be called when your page will be loaded.
And it wil then select all the labels for checkboxes and make it blank.

Have you ever worked on jQuery ?
ntitish 31-May-13 7:05am    
no sir i am new to this jquery...

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