/    Sign up×
Community /Pin to ProfileBookmark

Radio Buttons and Parent/Children

How would I go about writing this?

In a Javascript Function radio(obj) write code that if id=”radGroupParentY” is clicked then loop through all radio buttons below it and set the attribute checked=”true” to all their children id=”radGroupChildY” I can’t just say checked because it is within an XSL and it needs to be checked=”true”

As an example I only put 2 children but their could be more.

Parents
<input type=”radio” class=”NavMnuSecHeaderTitle” value=”Y” onClick=”radio(this)” id=”radGroupParentY” name=”clid123rid124″>Yes
<input type=”radio” class=”NavMnuSecHeaderTitle” value=”N” onClick=”radio(this)” name=”clid123rid124″ id=”radGroupParentN”>No

Children
<input type=”radio” class=”NavMnuSecHeaderTitle” value=”Y” id=”radGroupChildY” name=”clid126rid125″>
<input type=”radio” class=”NavMnuSecHeaderTitle” value=”N” id=”radGroupChildN” name=”clid126rid125″>

<input type=”radio” class=”NavMnuSecHeaderTitle” value=”Y” id=”radGroupChildY” name=”clid136rid135″>
<input type=”radio” class=”NavMnuSecHeaderTitle” value=”N” id=”radGroupChildN” name=”clid136rid135″>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@crh3675Jul 01.2005 — First off, you can't have elements with the same ID
Copy linkTweet thisAlerts:
@google_archive1Jul 27.2005 — indexed JUL 27 2005 12:29:59
×

Success!

Help @argoman 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 5.20,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...