Hi...
I'm not sure if anyone here can help me, but I'll try anyway. 😉
In short, my problem is follows:
<HTML>
<HEAD>
<script language="JavaScript">
<!--
function FileUpload()
{
document.form1.fileselect.click();
}
//-->
</script>
</HEAD>
<BODY>
<form name="form1" action="action.php" method="post" enctype="multipart/form-data">
<img src="imgview.php?filename=$filename" onClick="FileUpload()">
<input type=file size=25 maxlength=500000 name="fileselect" accept="image/*">
<input type=submit name="OKbutton" value="OK">
</form>
</BODY>
</HTML>
Now, if I click on the image, the file selection appears, I can select the file, and it appears in the input. But, once I click OK, all it does is to clear the file selection. If I chose the file manually by clicking on "Browse..." and then press the OK button, the file is sent to the action.php. I noticed this behaviour in IE 6. Mozilla and Opera simply ignore the Javascript completely.
Any suggestions on why the submit button only clears the input field, and how to fix this?
Thank you.
Marc