473,473 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checkbox select problems

here's my code:

<script type="text/javascript">
function checkUncheckAll(t, type) {
for(i=1; i<t.length; i++) {
if (t[i].name == "hosting[]" && type == "hosting")
t[i].checked=t[0].checked;
if (t[i].name == "se[]" && type == "se") t[i].checked=t[0].checked;
if (t[i].name == "ml[]" && type == "ml") t[i].checked=t[0].checked;
}
}
</script>
<form>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'hosting');"
checked>select/unselect all hosting<br>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'se');"
checked>select/unselect all search engine<br>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'ml');"
checked>select/unselect all mailing list<br>
For some reason it only seems to work for whatever call to checkUncheckAll()
is first and not the other two. Any help would be appreciated.
Jul 23 '05 #1
1 2829
ok, i just figured this out. i'm stupid. :P
"mike robinson" <po**@hole.com> wrote in message
news:f-********************@rogers.com...
here's my code:

<script type="text/javascript">
function checkUncheckAll(t, type) {
for(i=1; i<t.length; i++) {
if (t[i].name == "hosting[]" && type == "hosting")
t[i].checked=t[0].checked;
if (t[i].name == "se[]" && type == "se") t[i].checked=t[0].checked;
if (t[i].name == "ml[]" && type == "ml") t[i].checked=t[0].checked;
}
}
</script>
<form>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'hosting');"
checked>select/unselect all hosting<br>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'se');"
checked>select/unselect all search engine<br>
<input type="checkbox" onclick="checkUncheckAll(this.form, 'ml');"
checked>select/unselect all mailing list<br>
For some reason it only seems to work for whatever call to
checkUncheckAll() is first and not the other two. Any help would be
appreciated.

Jul 23 '05 #2

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

Similar topics

7
by: Old Lady | last post by:
Hi all, I have a problem when I try to send an array using a form when the type="checkbox". This is my form input row: <INPUT type="Checkbox" name="flg" value="y" <? if($row == 'y') echo...
4
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get...
4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
6
by: Bill Nguyen | last post by:
I need to add a checkbox in front of all the rows in a datagrid so that users can select/unselect them. Any help is greatly appreciated! Bill
34
by: clinttoris | last post by:
Hello Experts, I have been told to post this in the Javascript forum as I want to do this client side just before my form gets submitted. Once the user clicks the submit button a javascript...
0
by: New2ASP | last post by:
Thanks everyone in advance for your help. I am fairly new to web development but an experienced window-based developer. Here's the structure of my Gridview Column 1 : Checkbox with SelectAll...
1
by: peck2000 | last post by:
Related to my earleir post ... this is the same project to re-purpose the Classifieds application in BEGINNING ASP 3.0 (Wrox) to a comicbook database ... This is a brainteaser that should have...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
11
by: =?Utf-8?B?UGFyYWcgR2Fpa3dhZA==?= | last post by:
Hi All, I have a large recordset to be displayed on a ASP 3.0 page. I am using recordset paging for this. For the next and previous link i am passing href as <a href=<Page URl>?page=<%=...
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.