Solved

HTML Form onChange Submit

Posted on 2004-10-13
5
1,048 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 125 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 125 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

728 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