Hi
i wonder if anyone can help solve this problem. I am guessing that it will probably be
a simple and silly oversight on my part, but being new to JavaScript I am not quite
sure where I am going wrong.
Problem:
using a checkbox I wish to disable or enable certain part of a form. The parts in question
being a button and a text field.
Below I have included a sample snippet of the code that i have used without any success:
function disable(){
if(document.test.testBox.checked==true){
var button = document.getElementByTagName(“input”);
button[2].value = “please wait”;
button[2].disabled = “true”;
}else{
button[2].disabled = “false”;
}//end
function disableTwo(){
var button = document.getElementById(“testButton”).value;
button.disabled = “false”;
}//end
</script>
</head>
<input type = “checkBox” id = “testBox” name = “testBox” value=”test” onClick = “disable();”> Test