C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » ASP.NET WebForms »

CheckBox Gridview Valid


Posted Date: 16 Sep 2009    Resource Type: Code Snippets    Category: ASP.NET WebForms
Author: palaniellappankMember Level: Silver    
Rating: 1 out of 5Points: 4



GridView Checkbox


This code shows gridview checkbox valid or not


<script type="text/javascript">
var TargetBaseControl = null;
window.onload = function()
{
try
{
TargetBaseControl = document.getElementById('<%= this.grid_reneval.ClientID %>');
}
catch(err)
{
TargetBaseControl = null;
}
}

function TestCheckBox()
{
if(TargetBaseControl == null) return false;
var TargetChildControl = "CheckBox1";
var Inputs = TargetBaseControl.getElementsByTagName("input");
for(var n = 0; n < Inputs.length; ++n)
if(Inputs[n].type == 'checkbox' && Inputs[n].id.indexOf(TargetChildControl,0) >= 0 && Inputs[n].checked)
return true;

alert('Select at least one !');
return false;
}


</script>


<asp:TemplateField HeaderText="Member">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Text=" " />
</ItemTemplate>
<HeaderStyle HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="left" />
</asp:TemplateField>



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Gridview Checkbox  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Master Page
Previous Resource: Example on themes and skins
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use