C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Disabled CheckBox using javascript


Posted Date: 22 May 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: Bharathi       Member Level: Diamond
Rating:     Points: 10



Consider a checkbox as : Chk

Add the attribute to the checkbox as below:
chk.Attributes.Add("onclick", "javascript:Select('" + chk.ClientID + "')");

Javascript Function:






Responses

Author: komaladevi    27 May 2008Member Level: Gold   Points : 2
bharathi where is the code .... i think code is missing right ?


Author: Bharathi    27 May 2008Member Level: Diamond   Points : 2
Yes Komaladevi you are right ..
Thank You.

The code is :

function Select(id)
{
var obj = document.getElementById(id);
if (obj.checked) obj.checked =false; else obj.checked =true;
}



Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

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: How to Check all check boxes when you click on Select All button
Previous Resource: Disable right mouse click Script
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

accuconference

Contact Us    Privacy Policy    Terms Of Use