473,699 Members | 2,628 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

With the following code, I get the "message" whether or not there is
content in my filefield:

function check_file_fiel d()
{
var file_field = document.getEle mentById("custC artFile");
if(file_field.v alue.length == 0)
{
alert("You are required to select an Image");
return false;
}
else
{
return true;
}
}

<cfinput type="file" name="custCartT humb">
<cfinput type="submit" name="submit" value="Add Image" onClick="return
check_file_fiel d()">

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
2 2891
trint wrote:
<cfinput type="file" name="custCartT humb">
<cfinput type="submit" name="submit" value="Add Image" onClick="return
check_file_fiel d()">

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
Peter Michaux said the following on 11/15/2006 3:09 PM:
trint wrote:
><cfinput type="file" name="custCartT humb">
<cfinput type="submit" name="submit" value="Add Image" onClick="return
check_file_fie ld()">

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.javas cript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3961
by: atse | last post by:
Hi, In the file field <input type="file" name="file1">, can I modify the button "Browse..."? I want to hide the file field but show a button like "Open". When I click on this button, it catches a file, and use onchange even to upload this file. thanks for any idea. Atse
1
5548
by: Monte Chan | last post by:
Hi all, I have the following codes, <script language="JavaScript"> function check_stuff(field) { alert("blank out the field now"); field.value = ""; } </script>
2
2801
by: Anne | last post by:
hie all, i have dragged a File Field control from the HTML tab to my page and i am able to browse and retrieve the file i want. the only problem i have is, i do not want my users to be able to browse to other folders. i want them to be able to just browse at the specific folder only. in other words, i just want them to be able to view at the specific folder when the browser button is clicked. i have tried looking in the properties, but...
10
1733
by: Eddy | last post by:
I am coding a ASP to process a excel file and output the reults to a text file. To browse for the file that i want to process i used the File field to return the location of the file. My problem begins here when I click on the browse it show me my harddrive and I slect the file and it show up in the window "C:\test1.xls". however when I press the button to process the it returns an error telling me that the file cannot be found. I did a...
0
1080
by: davesil2 | last post by:
I am using the File Field HTML Control in my asp.net page. I believe what I need to do is use a custom validator against that control to check if the file size is too large. I don't know where to go or how to get started for the client side script though. could someone help me? -David Silberhorn
6
2011
by: msuk | last post by:
All, I have a ASP.NET/C# webform which contains a Webform button that has a CssClass applied to give it a special effect. Now the same webform has a filefield control but the browse button is the default. I would like to apply the same CssClass style to the browse button is this possible and how? Thanks Msuk
4
1046
by: Tim::.. | last post by:
Can someone tell me what operator I use to check if the datasource has any content? Thanks Exception Details: System.InvalidCastException: Operator is not valid for type 'SqlDataReader' and string "". Source Error: Line 62: Dim myReader As SqlDataReader = cmd.ExecuteReader()
1
1314
by: ADM - Dan | last post by:
I have an application that uses a file field control to get an Excel file from the users local PC, then process the content of the file to update a database table. I am able to: 1. Get the file name 2. Use "postedFile.InputStream.Read(fileBytes, 0, FileLen)" to read the file content into a byte array 3. Use "fStorage.Serialize(msStorage, fileBytes)" to serialize the byte array into a memory stream.
6
13591
by: Mike Charney | last post by:
Is there a way to check a files date and time stamp from VBA in access. I have a need check a date stamp on a file that I am importing. Thanks in advance, Mike m charney at dunlap hospital dot org
0
8685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7745
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.