/    Sign up×
Community /Pin to ProfileBookmark

Disable Radio by checking checkbox

hey everyone, im new to javascript and need to figure out a way to put some java into my .php validation i am doing. i am looking to disable a group of radio buttons as well as a group of textboxes, but only if 1 certain checkbox is checked. Does anyone have any idea to begin this process. i have some slight code ill put in but it was from a tutorial i found online. any help is appreciated thank you in advance

[CODE]<script type=”text/javascript”>
<!–
function DisableRadioGroup(radioGroup, disable)
if(window.document.form1.OwnersManual.checked=true){
for(var i=0; i < radioGroup.length; i++)
{
radioGroup[i].disabled = false
}
}

else
{
for(var i=0; i < radioGroup.length; i++)
{
radioGroup[i].disabled = true
}
}
}

//–>
</script>[/CODE]

<input type=”checkbox” name=”OwnersManual” value=”ResendOwnersManual” onClick=”disableRadioGroup(ServiceName,(this.value.length == 0))”>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@kdcgrohlDec 28.2006 — try something like this:
<i>
</i>&lt;form name="form"&gt;
&lt;input type="checkbox" name="check1" onClick="if(this.checked){document.form.input1.disabled=true;}else{document.form.input1.disabled=false;}"&gt;
&lt;input type="text" name="input1"&gt;
&lt;/form&gt;
Copy linkTweet thisAlerts:
@NickG21authorDec 28.2006 — would i use to same basic function that i had in my code before?

sorry for stupid questions this is my first javascript use
×

Success!

Help @NickG21 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,
)...