Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Select/Unselect all | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Mercury

Shyguy
Level: 16

Posts: 35/88
EXP: 18132
For next: 2124

Since: 07-08-04
From: Hihihi.

Since last post: 1 day
Last activity: 1 day
Posted on 10-05-04 01:55 PM Link | Quote
I know you have to do it in Javascript, and I've search around a bit for free scripts, but none kinda worked .

How could I select or unselect all checkboxes on a form with one click?
neotransotaku

Baby Mario
戻れたら、
誰も気が付く
Level: 87

Posts: 1449/4016
EXP: 6220548
For next: 172226

Since: 03-15-04
From: Outside of Time/Space

Since last post: 11 hours
Last activity: 1 hour
Posted on 10-06-04 02:29 AM Link | Quote
I believe it is related to DOM manipulation and you have to get a hold of all the checkboxes, and for each checkbox, you set it.

Although the following information is for Mozilla, the same approach works for IE:
Explanation of relationship between DOM and Javascript
DOM information from W3
Modereb

Paragoomba
Level: 15

Posts: 67/75
EXP: 14749
For next: 1635

Since: 06-04-04

Since last post: 350 days
Last activity: 339 days
Posted on 10-06-04 07:15 AM Link | Quote
Originally posted by neotransotaku
I believe it is related to DOM manipulation and you have to get a hold of all the checkboxes, and for each checkbox, you set it.

Although the following information is for Mozilla, the same approach works for IE:
Explanation of relationship between DOM and Javascript
DOM information from W3
You're been talking about the DOM in almost every JavaScript related thread lately but you rarely come up with an actually useful answer...

Anyway...


Checkbox 1
Checkbox 2
Checkbox 3




<form name="cboxform">
<input type="checkbox" name="cbox1" /> Checkbox 1
<input type="checkbox" name="cbox2" /> Checkbox 2
<input type="checkbox" name="cbox3" /> Checkbox 3
<input type="button" value="Select all" onclick="document.forms.cboxform.cbox1.checked=1; document.forms.cboxform.cbox2.checked=1; document.forms.cboxform.cbox3.checked=1;" />
<input type="button" value="Unselect all" onclick="document.forms.cboxform.cbox1.checked=0; document.forms.cboxform.cbox2.checked=0; document.forms.cboxform.cbox3.checked=0;" />
</form>
Mercury

Shyguy
Level: 16

Posts: 37/88
EXP: 18132
For next: 2124

Since: 07-08-04
From: Hihihi.

Since last post: 1 day
Last activity: 1 day
Posted on 10-06-04 12:35 PM Link | Quote
Thanks, very helpful !
Zem
You can be civil without being flowery, dipshits.
Level: 49

Posts: 215/1107
EXP: 829398
For next: 54485

Since: 06-13-04

Since last post: 131 days
Last activity: 131 days
Posted on 10-12-04 04:21 PM Link | Quote
If you're using a script (e.g. php) which could generate any number of checkboxes, it's more efficient to run through every element in the form and check it if it's a checkbox. Not that I remember how to do that, but I thought I'd point that out. =(
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - Select/Unselect all | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.008 seconds.