[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

input type file prob

Posted on 2004-04-04
9
Medium Priority
?
141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
9 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
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 

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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
What You Need to Know when Searching for a Webhost Provider
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

649 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