Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

disable checkboxes with the click of a button

10:06 pm on Jan 9, 2004 (gmt 0)

Full Member

10+ Year Member

joined:July 11, 2003
votes: 0

Does anyone know how to disable a certain pair of checkboxes if a particular radio button is pressed?
10:55 pm on Jan 9, 2004 (gmt 0)

Full Member

10+ Year Member

joined:Nov 17, 2002
votes: 0


function skip () { this.blur(); }
function disableTextField (field) {
if (document.all ¦¦ document.getElementById)
field.disabled = true;
else {
field.oldOnFocus = field.onfocus;
field.onfocus = skip;
function enableTextField (field) {
if (document.all ¦¦ document.getElementById)
field.disabled = false;
else {
field.onfocus = field.oldOnFocus;
<FORM NAME="aForm">
<INPUT TYPE="text" NAME="aField" VALUE="Kibology">
<INPUT TYPE="button" VALUE="disable field"
<INPUT TYPE="button" VALUE="enable field"

This uses buttons to enable and disable a field, a little bit of tinkering should make the radio buttons do it. This is a subject I have literally just started researching.