Jump to content

Archived

This topic is now archived and is closed to further replies.

hardyvoje

Providing default info to File form object in HTML?

Recommended Posts

Hello,

Another thing that i have to ask,
I''m developing automatic tutorial submission tool using PHP (of course :) )
(project is stable beta: http://www.omnetwork.net/ta )

I have passed field info with $_POST and $_SESSION and then integrated it to HTML of next form (goal is to enable users to enter info about Tutorial at one page and then just to click - next, next, next and to submit it to 20+ tut indexes....)

like this:
[code]<input id="siteurl" name="siteurl" type="text" size="50" maxlength="50" value="<?php echo $row['url']; ?>" />[/code]

But is there way to pass info to file form object?
I've tried:
[code]<input name="thumbnail" type="file" size="25"  value=<? php echo $row['avatar']; ?> />?[/code]

but nothing, File object left empty.

Thanks in advance!

Share this post


Link to post
Share on other sites
I think its not possible to provide a defualt value for a file input box.

Share this post


Link to post
Share on other sites
It seems to me same... thanks anyway

But if someone has some great idea :) how to solve this, you're welcome!

Share this post


Link to post
Share on other sites
I think Javascript can set it, but I'm not sure.

Ken

Share this post


Link to post
Share on other sites
From looking at the w3c html specs, it says you can use value, however it is down to the user agent (web browser).
[quote=http://www.w3.org/TR/html4/interact/forms.html]Creates a file select control. User agents may use the value of the value attribute as the initial file name.[/quote]
So it appears the people that create browsers opt to not use the value attribute for a file object.

Share this post


Link to post
Share on other sites
hmm... using JS seems good idea for me

Has anyone snippet for such or similar thing?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.