T
trint
With the following code, I get the "message" whether or not there is
content in my filefield:
function check_file_field()
{
var file_field = document.getElementById("custCartFile");
if(file_field.value.length == 0)
{
alert("You are required to select an Image");
return false;
}
else
{
return true;
}
}
<cfinput type="file" name="custCartThumb">
<cfinput type="submit" name="submit" value="Add Image" onClick="return
check_file_field()">
It's like the function does not detect if the cfinput type="file"
contains anything!
Any help is appreciated.
Thanks,
Trint
content in my filefield:
function check_file_field()
{
var file_field = document.getElementById("custCartFile");
if(file_field.value.length == 0)
{
alert("You are required to select an Image");
return false;
}
else
{
return true;
}
}
<cfinput type="file" name="custCartThumb">
<cfinput type="submit" name="submit" value="Add Image" onClick="return
check_file_field()">
It's like the function does not detect if the cfinput type="file"
contains anything!
Any help is appreciated.
Thanks,
Trint