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
Solved

"File Field" form element not working (ASP.VB/MS Access)

Posted on 2003-11-10
9
523 Views
Last Modified: 2010-04-25
I have a record insertion page that allows the user to input the date on which a MS Word document was created. I want the user to also insert a hyperlink to this document, which resides on the same server as the web site and database.

Rather than making them hand-code the link, I'd like them to be able to "browse" for it from the record insertion page, and once the page submits the hyperlink will be in the database.

I'm trying to use the "file field" form element from the DW form behaviors, but as soon as I put the "file field" in, the form no longer submits. If I just have the date text field, the form populates the database with the date. As soon as I put the file field in, the form no longer submits. I don't even have any insert behavior assoviated with it - just the act of putting it in the form causes the form to no longer work.

Help?
0
Comment
Question by:stewboy
9 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9723503
stewboy You cant just use the FILE field like this.

file field is good if you want to UPLOAD files to your server into a Specific Folder AND you have 3rd Party Component's installed on your Server to accept file Field Upload. http://aspUpload.com is a good website to learn about using File upload's.

if you want your users to input the URL then let them Type it, thats the Best solution without using Filefield. otherwise get the Component to accpet file upload's.
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9723641
> I posted this question, but it makes no sense, and no one will be able to provide me with a logical, working answer.

stewboy what do you mean by it makes no sense?
I gave you the Answer to your question, that you trying to do something and its not quit possible, if you think you are confused OR you think i am wrong then please continue the Post to ask more questions about your problem.
0
 

Author Comment

by:stewboy
ID: 9725059
Not trying to duck you adilkhan. I asked to have it pulled before I  saw that you had posted a Comment. The reason I asked for it to be pulled is that I'm trying to use the file field for something it's not designed to do.

I'm looking for a way that a user can browse for the location of a document, and then input that link to the database, where it will reside as a hyperlink. What the file field button is doing, at least superficially, is exactly what I want.  I don't actually want the file to be uploaded, just the link information.

However, just because I want it to do something doesn't mean it actually will.

Can you help me find another way to allow user "browsing" for a file location?
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9725423
Thanks for Clearification.
Thats not quite possible because of Security Reasons.
0
 

Expert Comment

by:shoeman22
ID: 9726680
I haven't tested this out, but it may work:
The idea is that you can use the <input type="file"> element to display the location of the file, then, when you submit the form, you can trigger a JavaScript function to pass the text value from the "file" input box into a "hidden" field.

Then, when you submit it to the server, you will be able to reference the hidden field, containing the url of the "file" field, just like you would any other text field.
--------------------------------------------------------------------------------------------
<script language="javaScript">
function setHidden(theFileField,theFileName) {
     theFileName.value=theFileField.value;
}
</script>


<form action="form.asp method="post" name="myForm" onSubmit="setHidden(this.myFile,this.myFileName);">
<input type="file" id="myFile" name="myFile">
<input type="hidden" id="myFileName" name="myFileName">
<input type="submit">
</form>

--------------------------------------------------------------------------------------------
Let me know if you need any more help,
shoeman22
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9728127
shoeman22 I know what you mean.
But the Problem is FILE field has many Security Issues, You can not set the Value of the Hidden Field from the File field VIA Client Side Language such as javaScript.
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 9755276
PAQed, with points refunded (125)

SpazMODic
EE Moderator
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

860 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