Re: Upload, input type=file, submit button
- From: "Larry Brown" <lbrown@xxxxxxx>
- Date: Tue, 16 May 2006 14:17:17 +0200
"Randy Webb" <HikksNotAtHome@xxxxxxx> a écrit dans le message de news:
hrqdnSFb_Mzu8vXZ4p2dnA@xxxxxxxxxxxxxx
Larry Brown said the following on 5/15/2006 3:55 AM:
Hi,
I still have the same problem with the input type=file element, its
browse button, and the submit of the form.
No, these are new issues.
Sorry, I posted something abotu this a few days ago (may 4)
I want to hide the grey old-fashioned Browse button of the input
type=file with another button.
There is a reason why you are having so much trouble trying to hide the
input type="file" default look. It is a security issue. If you could
programatically click it, fill it out, and submit the form then you have a
very huge security hole.
I don't want to submit the form automatically. I just want to open a browse
popup window, nothing more. Which I suppose is not such a big risk.
As for styling it, you can't.
<URL: http://www.cs.tut.fi/~jkorpela/forms/file.html#present>
When I click on this button, it simulates a click on the Browse button.
This works fine.
Only in IE.
Then:
- if I use a submit button, I have to click twice on it: the first time
it simply clears the input field, and the second time the form is really
posted, but the result is empty (no file).
Welcome to the security issue.
- if I use a form.submit() function (which I would prefer because I have
things to control before I submit the form), I get an "Access denied"
error from my IE.
Don't use form.submit(), use the onsubmit handler of the form:
<form onsubmit="return checkForm()">
Then you do your things in the checkForm function and return true or false
to submit the form or cancel the submission.
If you want, but...this doesn't change anything to my problem.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/
I found this, but did not test. Looks a bit complicated, but since I don't
have any other idea, I may try it. And the last paragraph there is of course
quite clear...
Thanks anyway for your reply.
.
- Follow-Ups:
- Re: Upload, input type=file, submit button
- From: Randy Webb
- Re: Upload, input type=file, submit button
- References:
- Upload, input type=file, submit button
- From: Larry Brown
- Re: Upload, input type=file, submit button
- From: Randy Webb
- Upload, input type=file, submit button
- Prev by Date: Activating ActiveX Controlsmakes the controls active
- Next by Date: Title: javascript Fade-in and Fade-out effects
- Previous by thread: Re: Upload, input type=file, submit button
- Next by thread: Re: Upload, input type=file, submit button
- Index(es):