473,387 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

checkbox handling...

hi i have five check box. it has text as one, two, three ,four and all corrrespondingly.

the task is the first four (1 to 4) checkbox can be checked and unchecked independently. Coressponding text of the checked checkbox must be returned . Now if i select last checkbox ( all ) ,the other four check box must also be checked along with (all) check box and text all should return. if i uncheck the all chekbox , the other four check box must also be unchecked.

can any one help with c# code.. for this...i'm a fresher.
Sep 2 '07 #1
2 1140
phvfl
173 Expert 100+
Hi,

Is this a windows form or a web page?

If this is a windows form put some action onto the CheckChange event of the final checkbox. If this is a webpage then you would have to either use the AutoPostback property of the checkbox or write some javascript to handle the checking/unchecking of the checkbox.
Sep 2 '07 #2
shweta123
692 Expert 512MB
Hi,

You can try this code on onClick Event of allcheck Checkbox.
<html>
<head>
<script Language = "javascript">
function chekAll()
{
var myArray = new Array()
If(document.getElementById('AllCheck').checked)
{
document.getElementById('Check1').checked = true;
myArray[0] = document.getElementById('Check1').value
..
..
..
document.getElementById('Check4').checked = true;
myArray[3] = document.getElementById('Check4').value
return myArray;
}


}





</script>
</head>
<body>
<input type="checkbox" Id="Check1" value="Check1">
...
..
..

<input type="checkbox" Id="Check4" value="Check4">
<input type="checkbox" Id="AllCheck" value="AllCheck">
</body>
</html>


Hi,

Is this a windows form or a web page?

If this is a windows form put some action onto the CheckChange event of the final checkbox. If this is a webpage then you would have to either use the AutoPostback property of the checkbox or write some javascript to handle the checking/unchecking of the checkbox.
Sep 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bill | last post by:
I have a catalog of books which need to be categorized into different groups. Some of the books can be listed under more than one category. I'm creating a page where I can assign a group of books...
10
by: Dan | last post by:
When using checkboxes on a form, if you uncheck them, the unchecked name/value pair in the Request.Form collection doesn't show up. It only shows when the checkbox is set to ON. Is this...
7
by: Tony Williams | last post by:
I have a check box called Loadtxt and when it is ticked I want the value of a control called EmailDatetxt to be today's date. I am using this code in the AfterUpdate event of the checkbox but it...
4
by: UJ | last post by:
I've got an page that dynamically generates a table (don't ask!) that includes in each cell a checkbox. I can get the checkbox create but I can't figure out how to get an event tied to it so that...
1
by: Stu Lock | last post by:
Hi, I have a checkbox in a gridview template column with autopostback turned on. I want to be able to handle this event but am unsure how. With other control of this nature I have used...
1
by: dave | last post by:
I have a html table and mutliple rows. On each row i put an onclick event that opesn a modal window and prompts the user for some information. I want this modal window to show when the user...
2
RayTracy
by: RayTracy | last post by:
I´m trying to add a value to totalsum when checking a checkbox. But I'm a n00b at this and I can't find any relevant information on the Internet to help me with my little problem. I'm only...
8
by: Grorange | last post by:
Writing ASP.NET pages, I have a need for client-side functions to prevent going to the server for every small change. I have a list of server side created checkboxes filled with a lot of...
1
by: iderocks | last post by:
Hi All, I created a dynamic checkbox in ASP .Net inside a Button1_Click event method (outside the page_load event) and performed the event handling method for the CheckedChanged event and when I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.