Posted by Noozer on 06/05/05 18:50
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>
Navigation:
[Reply to this message]
|