/    Sign up×
Community /Pin to ProfileBookmark

disable radio if

How do I disable a radio if a text box named Jul = “A”. Thanks in advance for any help you can give.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@WebJoelJun 02.2008 — Need a LOT more information (and some code) to understand what you are asking for here... ??
Copy linkTweet thisAlerts:
@landslideauthorJun 02.2008 — Im sorry what I am trying to do is I have a box that is populated on load. What I want to do is if that box is = to A then I want the box next to it to be disabled if it is not then it is not disabled thats it. I have some similar code I am trying to change to fit this situation. Any help you can give would be great.


<script type="text/javascript">

function disableRadioGroups() {

var forms, el, radioGroup;

var i = end = j = elsEnd = rg = rgEnd = 0;

if (document.getElementsByTagName) {

forms = document.getElementsByTagName('form');

/* Loop through all the FORMs */

for (i, end = forms.length; i < end; i++) {

/* Loop through each form element */

for (j = 0, elsEnd = forms[i].elements.length; j < elsEnd; j++) {

el = forms[i].elements[j];

/* If this is a checked, enabled radio button in a radio group... */

if (!el.disabled

&& el.nodeName === 'A'

&& el.type == 'text'

&& el.checked

&& forms[i].elements[el.name].length) {

radioGroup = forms[i].elements[el.name];

/* Loop through radio group and disable buttons */

for (rg = 0, rgEnd = radioGroup.length; rg < rgEnd; rg++) {

radioGroup[rg].disabled = true;

}

}

}

}

}

}





window.onload = function() {

disableRadioGroups()

};



</script>
Copy linkTweet thisAlerts:
@JMRKERJun 03.2008 — Are you trying to have the user click on an acceptance statement

(either a radio button or a checkbox)?

If so, see if this help. ?

See: http://www.webdeveloper.com/forum/showthread.php?t=182477

If not, just ignore post ?
Copy linkTweet thisAlerts:
@landslideauthorJun 03.2008 — No its is not and acceptance but thanks for the reply
×

Success!

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