hrm.. works for me. eg:
Code:
<script>
<!--
function check_form(form) {
if (form.foo.value == "") {
alert("foo is required!");
form.foo.focus();
return false;
}
return true;
}
//-->
</script>
<form name="me" action="<?=$_SERVER['PHP_SELF']?>" method="POST" onsubmit="return check_form(this);">
<input type="file" name="foo">
<input type="submit">
</form>