I need to check if a file input box is undefined, but I can not get this to work.
If I alert(document.lform.logoimage.value); , it pops up: "undefined"
So I have tried to evaluate that field to "undefined" and "", and neither work.
so how can I check if a file is not there? i only want this confirmation box to pop up if the user has chosen a file to upload. ( there are other text elements on the form )
HTML Code:
<Script language="JavaScript">
<!--
function verifyLogo(){
if( document.lform.logoimage.value != "" ){
var c = confirm("Are you sure you want to replace the logo image?\nThe current image will be deleted.");
if( c ){
return true ;
}else{
return false ;
}
}
return true ;
}
-->
</script>