...

View Full Version : inactive buttons



Tails
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.

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

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

Tails
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!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum