Click here to Skip to main content
16,004,887 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi all
i have displayed a tree using javascript and each node of this tree has ID , Name, and a check box . now i want when the user clicks on "Add" Or "Submit" button , check for all nodes checked in this tree.
can any one tell me a methodology to to that, please

thanks
Posted
Comments
saud_a_k 7-Nov-12 2:07am    
Do you want this done from the server? how are you creating the tree in the first place?
Just to check the checkboxes, you'll have to use document.getElementById('chk').value=true;
Sergey Alexandrovich Kryukov 7-Nov-12 2:08am    
It's simple, just needs some time. What did you try so far? By the way, do it with jQuery which greatly improves code for such things.
--SA

1 solution

you can use jquery.
have to follow following steps.
1. download jquery.js from
jquery.com
2.add script tag in head
HTML
<script src="jquery-1.4.1.min.js" type="text/javascript"></script>


3. write a script
JavaScript
<script type="text/javascript">
	    $(function () {
	        $("#yourButton").click(function () {
	            ('input[id*="deleteRec"]').attr('checked', false);
	        });

	    });
        
</script>
 
Share this answer
 

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