<html>
<head>
<script type="text/javascript">
<!--
function checkIt(o){
var files=document.test.childNodes; for(var i=0; i<files.length; i++){
if(files[i].tagName=='INPUT' && files[i].type=='file')
if(files[i].value=='')
return false;
}
o.disabled='disabled';
return true;
}
//-->
</script>
</head><body>
<form name="test" action="test">
<input type="file" />
<input type="file" />
<input type="submit" onclick="return checkIt(this)" />
</form>
</body>
</html>
<head>
<script type="text/javascript">
<!--
function checkIt(o){
var files=document.test.childNodes; for(var i=0; i<files.length; i++){
if(files[i].tagName=='INPUT' && files[i].type=='file')
if(files[i].value=='')
return false;
}
o.disabled='disabled';
return true;
}
//-->
</script>
</head><body>
<form name="test" action="test">
<input type="file" />
<input type="file" />
<input type="submit" onclick="return checkIt(this)" />
</form>
</body>
</html>
<script>
function Check()
{
var FileArray = document.getElementsByName("file");
var disabled = false;
for(var i = 0;i < FileArray.length;i++)
{
if(FileArray[i].value != "")
{
disabled = true;
break;
} }
event.srcElement.setAttribute("disabled",disabled);
}
</script>
<form>
<input name="file" type="text">
<input name="file" type="text">
<input name="file" type="text">
<input name="file" type="text">
<input type="button" onclick="Check()" value="Upload"></form>