Jump to content


Photo

Providing default info to File form object in HTML?


  • Please log in to reply
5 replies to this topic

#1 hardyvoje

hardyvoje
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationSerbia

Posted 23 July 2006 - 02:46 PM

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:
<input id="siteurl" name="siteurl" type="text" size="50" maxlength="50" value="<?php echo $row['url']; ?>" />

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

but nothing, File object left empty.

Thanks in advance!
I'm running free design resources portal with photos, illustrations, 3d models, web templates, themes, sounds, loops, tutorials... etc. All resources are public domain - usable in commercial and non commercial projects. check it!

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 23 July 2006 - 02:50 PM

I think its not possible to provide a defualt value for a file input box.

#3 hardyvoje

hardyvoje
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationSerbia

Posted 23 July 2006 - 02:51 PM

It seems to me same... thanks anyway

But if someone has some great idea :) how to solve this, you're welcome!
I'm running free design resources portal with photos, illustrations, 3d models, web templates, themes, sounds, loops, tutorials... etc. All resources are public domain - usable in commercial and non commercial projects. check it!

#4 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 23 July 2006 - 02:54 PM

I think Javascript can set it, but I'm not sure.

Ken

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 23 July 2006 - 03:08 PM

From looking at the w3c html specs, it says you can use value, however it is down to the user agent (web browser).

Creates a file select control. User agents may use the value of the value attribute as the initial file name.

So it appears the people that create browsers opt to not use the value attribute for a file object.

#6 hardyvoje

hardyvoje
  • New Members
  • Pip
  • Newbie
  • 6 posts
  • LocationSerbia

Posted 23 July 2006 - 04:18 PM

hmm... using JS seems good idea for me

Has anyone snippet for such or similar thing?

I'm running free design resources portal with photos, illustrations, 3d models, web templates, themes, sounds, loops, tutorials... etc. All resources are public domain - usable in commercial and non commercial projects. check it!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users