/    Sign up×
Community /Pin to ProfileBookmark

Check all checkboxes using a checkbox

Hi guys n girls

I have a site that i am building at the moment which i have stumbled across a problem which i have never needed to do before.

Basically i have 2 or 3 seperate groups of checkboxes for example

[QUOTE]

<input type=”checkbox” name=”premium” value=”1″ />
<input type=”checkbox” name=”premium” value=”2″ />
<input type=”checkbox” name=”premium” value=”3″ />

<input type=”checkbox” name=”non” value=”1″ />
<input type=”checkbox” name=”non” value=”2″ />
<input type=”checkbox” name=”non” value=”3″ />

[/QUOTE]

What i need is another checkbox beneath each of these saying “tick all”

So if you press the checkbox for tick all underneath premium then it will tick all the boxes with the name premium.

I am able to do this with javascript using a button but i would rather use another checkbox which ticks them all.

Please help

thanks in advance.

TAV3RN

to post a comment
HTML

1 Comments(s)

×

Success!

Help @TAV3RN spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...