By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,606 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,606 IT Pros & Developers. It's quick & easy.

Need to check file field for content in <cfinput type="file" name="custCartThumb">

P: n/a
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

Nov 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
trint wrote:
<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!
What is cfinput? It isn't an html tag.

http://www.w3schools.com/tags/default.asp

Peter

Nov 15 '06 #2

P: n/a
Peter Michaux said the following on 11/15/2006 3:09 PM:
trint wrote:
><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!

What is cfinput? It isn't an html tag.

http://www.w3schools.com/tags/default.asp
It is Cold Fusion Server Side code.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.