Solved

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

Posted on 2003-11-10
9
520 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:adilkhan
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:adilkhan
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 23

Expert Comment

by:adilkhan
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:adilkhan
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now