HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 17th, 2004, 03:51 AM
amit.pandya amit.pandya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 amit.pandya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Pre Populating a Input type=file field

Hi
I need to populate an Input type=file field with a value from database or any kind of variable for that matter.
Is there a way I can do this?
I was told that using the <input type=file> for a method post form ignores the value attribute.
Is there another way to do this?

Thanks

Amit Pandya

Reply With Quote
  #2  
Old February 20th, 2004, 11:51 PM
dcarva's Avatar
dcarva dcarva is offline
Contributing User
ASP Free Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 633 dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level)dcarva User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 9 h 18 m 20 sec
Reputation Power: 6
As far as I know, this can't be done. There is not much you can do with the file input type.

Reply With Quote
  #3  
Old February 25th, 2004, 10:33 AM
bensaw bensaw is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 bensaw User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Amit -

I just came up with the same problem trying to clear out the value. In JavaScript you can alter the *outerHTML* value. Mine looked like:
document.myForm.imgFile.outerHTML = '<input type=file size=50 maxlength=250 name=imgFile value="">';

This cleared out the field (IE 6.0).

The converse of this might work as well, but be aware I haven't yet POSTed the data - there might be something internal that the Browse... button does, though I wouldn't think so, since you can type directly into the text box. - I'll let you know.

(Also- this might be considered unsafe depending on your audience - mine is quite small, and all on IE 6.0+)

Hope this helps - Ben

Last edited by bensaw : February 25th, 2004 at 10:43 AM.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Pre Populating a Input type=file field


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT