468,104 Members | 1,316 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,104 developers. It's quick & easy.

HTML + <input type="File">

Hi
I'm trying to set default value for input type file.

<input type="File" name="tx_pdffile" accept="*.pdf"
class="boxText" value="abc.pdf">

but this value (abc.pdf) doesnt appear in the text box..

Whats the solution???

Bhavin :(
Jul 19 '05 #1
2 7278
You cannot specify a default value, unless your users are running like
Internet Explorer 1.0 or something. This is a security issue, and you
cannot control this. If this were possible, people would make a form with
<input type=file value=C:\mycreditcardnumbers.txt> and then
document.formname.submit() it onload.

Ray at home

"Bhavin" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Hi
I'm trying to set default value for input type file.

<input type="File" name="tx_pdffile" accept="*.pdf"
class="boxText" value="abc.pdf">

but this value (abc.pdf) doesnt appear in the text box..

Whats the solution???

Bhavin :(

Jul 19 '05 #2
> I'm trying to set default value for input type file.

Nope, can't be done. Thankfully. Your user will have to browse for the
file.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Jesper Hermansen | last post: by
7 posts views Thread by Tim Slattery | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.