473,394 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

"Access Denied" submitting form with Javascript?

The following javascript code generates an "Access denied" error at the
indicated line.

This sample should allow the user to click "Browse" and choose a file. Once
the user has selected a file the form is automatically submitted. I'm trying
to avoid having seperate browse and submit actions.

Can someone explain why I'm getting the error and how I can accomplish this
task?

Thx!

<html>
<head></head>

<body>

<form name="form1" id="form1" method="post" action="test.htm">
<input type="button" value="Browse" onclick="return vlu();">
</form>

<form name="form2" id="form2" method="post" action="test.htm"
style="display:none;">
<input type="file" name="file1" id="file1">
</form>

<script language="javascript"> <!--
function vlu() {
form2.file1.click();
if (form2.file1.value != "") {
form2.submit(); //*** ERROR HERE
}
}
//-->
</script>
</body>
</html>


Jul 23 '05 #1
2 6073

Correct, the type="file" input element gives little access, reason why is
security, so, chances are, access is denied to many of its objects as well
as .click() method, run a For In on it maybe, to see which you can access,
but most do not give access due to security.

Danny

On Sun, 05 Jun 2005 13:03:39 -0700, Noozer <do*******@me.here> wrote:

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Jul 23 '05 #2
Lee
Noozer said:

The following javascript code generates an "Access denied" error at the
indicated line.

This sample should allow the user to click "Browse" and choose a file. Once
the user has selected a file the form is automatically submitted. I'm trying
to avoid having seperate browse and submit actions.


Besides the security issue, what if I just accidentally release
the mouse button over the wrong file? You don't want to make it
too easy to make a potentially serious mistake.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Frances Del Rio | last post by:
I'm getting Getting "Access is Denied" on resizeTo and moveTo methods in IE (IE 6.0..) I saw two posts about this from 7/6 & 7/7.. I suspect, like previous poster said, that this has to do w/MS...
1
by: Vaibhav Vashisht | last post by:
Hi, Here's a code snippet, Above is the html code and below is the javascript function Am Getting an error: -2147024891 "Access is denied" <body onload="Load();"> <form method=post ...
1
by: Darren Lew | last post by:
Hi there, I have this problem which is really driving me nuts for a couple of days. Glad if any help or suggestion is given Javascript will give me a pop-up error "Access is denied" when i try...
0
by: ASP.Confused | last post by:
The old message looked a little stale, so I am re-posting it here. Anybody have any ideas of what I could do?!? The previous responses to this question are below. If you want to look at the...
1
by: srivatsans101 | last post by:
Hi, I'm trying to access the IFrame contents on a HTML page as frames.document But in IE, I'm getting Access Denied Error Message. I tried to add the IFrame's Src WebSite (a...
0
by: =?Utf-8?B?TGVvbkc=?= | last post by:
I'm trying to upload a file using an asp:FileUpload control and an asp:LinkButton. This works fine, while there is an actual filepath in the fileupload upload control. Even an empty field works....
1
by: coyotemrh | last post by:
Using VB6 I am trying to call an access form. One site gave the code, but the first line was: Dim oAccess as Access.application When I try to run vb. it tells me that the user type has not been...
18
by: Jeff Bigham | last post by:
Hi, I'm getting an "Access is denied" error in IE when I try to focus an input box with node.focus() My understanding is that should only happen when the domains are different of the...
2
by: sphinney | last post by:
Hi everyone. I have a form in my Access 2007 database with a Microsoft Office Document Imaging Viewer Control 12.0 object on it. The object is named "GRAPHIC_mdv". When the form opens I want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.