?
Solved

HTML Form onChange Submit

Posted on 2004-10-13
5
Medium Priority
?
1,053 Views
Last Modified: 2012-08-13
Here is the code:

  <html>
  <head></head>
  <body>
    <form name="test_form" method="POST" enctype="multipart/form-data" action="uploadTester.asp">
      <input type="file" name="attach1" onChange="this.form.submit();" style="display: none;">
      <input type="button" onClick="attach1.click();" value="Select a File">
    </form>
  </body>
  </html>

The problem is the form is not submitting.  I'm getting an "Access is Denied." error.  If I change the style on the file input control so it will display, and click on that control directly, the form is submitted.  The problem with this is I don't want the users to see the text box associated with the file control so I developed this workaround.  I need to know why it won't submit this way though.

Thanks
0
Comment
Question by:macaulish
[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
5 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 12300713
The same as why you cannot give the file-type input a default value. It would be to hazardous. Besides: people don't like to have file selection things look different from what they used to. You should be aware that people are acustomed to how the file input works at all the sites they goto and use it. It is confusing to have it look differently or to have it act differently. What will you do if someone accidently selects msdos.sys or some other file and things submit automatically. This would give your visitor a great sense of insecurity. Therefor I my opinion, it is a good thing that this isn't working.

Regards

-r-
0
 
LVL 1

Author Comment

by:macaulish
ID: 12301417
Ronaan,

Thanks for your reply.  This is an intranet site with a limited amount of users in an asp database application.  The users do not need to see this control, they only need to pick a file to upload.

MacAulish
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 500 total points
ID: 12303073
You have two options.  Use a conventional form, or write an activex control that ignores the security restrictions, and wait for one of your users to exploit the hole to trash your database.

Cd&
0

Featured Post

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.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

762 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