disabling the file input element
I currently have my file input element disabled unless "2" is selected from the dropdownlist and a button is clicked. Once "2" is selected and the button is clicked, the file input element should be enabled. So far this is what my code looks like:
<head>
<script>
function NewWindow()
{
if (document.getElementById("dlstep").value == "2")
{
document.form1.txtCvsFile.disabled = false;
}
return false;
}
</script>
</head>
<INPUT id="txtCvsFile" name="txtCvsFile" style="WIDTH: 317px; HEIGHT: 22px" disabled type="file" size="33">
This is all in my aspx file. And the error I get is:
document.form1.txtCvsFile is null or not an object.
Can someone please tell me what I'm doing wrong or what I should be doing? Thanks.
|