View Full Version : inactive buttons

02-25-2003, 01:12 AM
I've seen inactive buttons on pages. The kind that are dimmed. You see these type of things in install programs where it does not become active until you check "I agree". I want to know how that is done and if I can also make checkboxes inactive too.

02-25-2003, 02:19 AM
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/TR/xhtml1">
<body onLoad="document.forms[0].elements[0].disabled = true">
<input type="button" value="Off">

Graeme Hackston
02-25-2003, 02:21 AM
document.getElementById('element').disabled = true;

02-25-2003, 09:26 PM
As simple as that was, I figured it out on my own as far as the disbled="disabled" attribute goes (I used setAttribute in a for loop too). But I never knew about document.forms[0].elements[0].disabled was even such a method. I always used document.forms[0][0]. Thanks!