473,669 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select multiple checkboxes

Hello,

I have 5 checkboxes in one record in the datagrid. When the user checks 5th
checkbox (or, in my case, clicks the button - doesn't matter to me), all
other checkboxes are checked as well.

I've done it in SelectedIndexCh anged event. My code is below.

However, it takes too long to work on the server side. I'm sure it is
possible to do the same in Javascript. Unfortunatley, I don't know it that
well. I've found many examples how to select all checkboxes in one column
using JS, but couldn't find anithing about selecting them in one row.

Could you please tell me how to do this in JS? I would appreciate it very
much.

My VB.NET code is here:

Private Sub dgData_Selected IndexChanged(By Val sender As Object, ByVal e As
System.EventArg s) Handles dgData.Selected IndexChanged

Try

Dim chk As CheckBox, btn As Button

Dim i As String = dgData.DataKeys (dgData.Selecte dIndex.ToString )

btn = CType(dgData.Se lectedItem.Find Control("btnAll "), Button)

chk = CType(dgData.Se lectedItem.Find Control("chkFro nt"), CheckBox)

If chk.Checked = False Then

chk = CType(dgData.Se lectedItem.Find Control("chkPay out"), CheckBox)

chk.Checked = True

chk = CType(dgData.Se lectedItem.Find Control("chkVar Data"), CheckBox)

chk.Checked = True

chk = CType(dgData.Se lectedItem.Find Control("chkQA" ), CheckBox)

chk.Checked = True

chk = CType(dgData.Se lectedItem.Find Control("chkFro nt"), CheckBox)

chk.Checked = True

chk = CType(dgData.Se lectedItem.Find Control("chkEPS "), CheckBox)

chk.Checked = True

btn.BackColor = Color.FromKnown Color(6699)

Else

chk = CType(dgData.Se lectedItem.Find Control("chkPay out"), CheckBox)

chk.Checked = False

chk = CType(dgData.Se lectedItem.Find Control("chkVar Data"), CheckBox)

chk.Checked = False

chk = CType(dgData.Se lectedItem.Find Control("chkQA" ), CheckBox)

chk.Checked = False

chk = CType(dgData.Se lectedItem.Find Control("chkFro nt"), CheckBox)

chk.Checked = False

chk = CType(dgData.Se lectedItem.Find Control("chkEPS "), CheckBox)

chk.Checked = False

btn.BackColor = Color.White

End If
--
Peter Afonin
Nov 19 '05 #1
0 1322

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2834
by: Ralph Freshour | last post by:
I have multiple checkbox's created with an array name because I have many on the same web page - their names are like: frm_chk_delete frm_chk_delete frm_chk_delete frm_chk_delete etc. Here is my code line that creates each checkbox (the php variable get
1
23197
by: Marek Mänd | last post by:
<select multiple style="height:200px;"> <option>a <option>b </select> Why does Mozilla draw the vertical scrollbar to the SELECT html element? There is plenty of void room below two OPTIONs in the SELECT box, so there is no need for that. How do i get the overflow:auto like thing working in mozilla based
12
8870
by: Forti2ude | last post by:
Hello, I have a simple form... <form> <select name="foo" multiple> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> </select>
2
5844
by: George Durzi | last post by:
This is more of a design/philosophical question :) I have a page in which the user sets attributes for a project. There are 8 attributes, e.g. Project Type, Country, etc. The number of options per attribute varies. The user is allowed to select as many options per attribute. I'm using a multi-select ListBox for this, and it works perfectly. The trouble I'm having is from a user perspective. Very few of the users seem to understand...
6
10078
by: Terry | last post by:
Good morning! How do I determine which SELECT button was clicked in a GridView? The multiple SELECT buttons will be used for an application approval process. Thank you in advance for your support in this matter.
5
2470
by: Sonnich | last post by:
Can anyone give me a quick hint for this? Say, I have: <SELECT NAME="opt3" SIZE="15" multiple> Then I'd like to list the items selected... echo $_POST; but this gives only the first one how do I get the rest?
3
16391
by: Robert Kilroy | last post by:
Greetings, I've been working on this for a few hours now. It seems to be a pretty simple task but I keep running into " has no properties". I have a select box defined as follows: <SELECT MULTIPLE NAME="myOptions" SIZE=5> <OPTION VALUE="Blue">Blue</OPTION> <OPTION VALUE="Red">Red</OPTION>
5
7018
by: TechnoAtif | last post by:
Hi All..'mAtif..i've got stuck within checkboxes these days..i've got many input items like checkboxes,textarea and along with them there are many checkboxes...all the data except the checkbox's is comfortably getting entered into the database but the real problem is with the checkboxes..only one entry is being stored ...but i want to enter the multiple entries from the checkboxes to enter into the database...the form is a voting poll..and i...
3
2784
by: camdev | last post by:
I have a form with 2 radio buttons and multiple checkboxes (see example below). The one radio button indicates all and the other radio button indicates the user has chosen specific options (checkboxes) from a list. Can I use javascript to automatically select the 2nd radio button if the users clicks on any of the checkboxes? <form name=form1> <input type=radio name=Radio1 value=All> <input type=radio name=Radio1 value=Specific> <input...
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8382
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7405
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4384
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2792
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.