PDA

View Full Version : Resolved Cycling through a form / diable property


sturgessweb
04-10-2010, 01:48 PM
Hi all,
I'm trying to get all the elements in a form to enable simulateously after 4 sec, then disable simulateously after 18. Here's my code and - guess what! - it's not working! I get no errors, so no help there :(

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<script>
function stop(){
for(i=0; i<document.CTTform.elements.length; i++){
document.CTTform.elements[i].diabled=true;
}
//document.CTTform.one.disabled=true;

}
function start(){
for(i=0; i<document.CTTform.elements.length; i++){
document.CTTform.elements[i].diabled=false;
}
//document.CTTform.one.disabled=false;
}
window.setTimeout('start()', 4000);
window.setTimeout('stop()', 18000);
</script>
</head>
<body>
<!-- Start of FORM -->
<form method="POST" name="CTTform" action="">
These will enable after a few seconds:
<input type="text" name="one" value="" disabled="true" /><input type="text" name="two" value="A value" disabled="true" /><input type="text" name="three" value="A value" disabled="true" /><input type="text" name="four" value="A value" disabled="true" /><input type="text" name="five" value="A value" disabled="true" />
</form>
<!-- End of FORM -->
</body>
</html>


The line that are commented out were workign on their own, but this "cycle through" script I picked up isn't :mad:

Thanks for any help in advance, I'll admit now I'm more a PHP man than a javascript one :thumbsup:

EDIT: Don't worry peeps, it's all sorted now