?
Solved

input type file prob

Posted on 2004-04-04
9
Medium Priority
?
143 Views
Last Modified: 2013-12-24
Ok i have an edit page..
its like this.. it reads a Y/N value from a database.. and poplates the checkbox as such..
next to it is a file upload.. which i want to work only if the user clicks it..

so basically how do i check whether anything is in the input file tage.. so i can upload a file if it doesnt exist..

0
Comment
Question by:chizzy60
  • 4
6 Comments
 
LVL 17

Expert Comment

by:Tacobell777
ID: 10754230
<cfparam name="yourQueryName.yourBooleanValue" default="false" type="boolean">

<input type="checkbox" onClick="document.getElementById('myFile').disabled = (document.getElementById('myFile').disabled == false) ? true : false;" value="true"<cfif NOT yourQueryName.yourBooleanValue> checked</cfif>>
<input name="myFile" id="myFile" type="file"<cfif NOT yourQueryName.yourBooleanValue> disabled="true"</cfif>>
0
 
LVL 17

Expert Comment

by:Tacobell777
ID: 10754233
<cfparam name="yourQueryName.yourBooleanValue" default="false" type="boolean"> should really be a value from your database, a boolean value, i.e. 0/1 yes/no, true/false
0
 
LVL 17

Accepted Solution

by:
anandkp earned 572 total points
ID: 10755707
why u wanna make the file upload dependent on the checkbox ?
u cld just chk if the user has selected a file for upload or not - if he has upload it - else dont

with having checkbox - u'll see that user may select the file & if he unchecks the checkbox - the file will still get uploaded - leaving the element of "confusion".
u might go ahead & avoid all this & then later on u'll realise that "disabled" dosent work in "netscape" [i know not many users use it]. but u have a loop hole left in there for netscape users!

rest depends how u wanna set things for ur site.

K'Rgds
Anand
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:chizzy60
ID: 11073916
everyone is way off... i want my points back!!
0
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 568 total points
ID: 11073956
cool, then you should do
<cfif len(form.theNameOfTheFileUploadField)>
  do the upload........
</cfif>
0
 
LVL 17

Expert Comment

by:Tacobell777
ID: 11073961
Or you should explain what you are after in a different way, I think you threw everyone off with you mentioning the checkbox.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Screencast - Getting to Know the Pipeline
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question