|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
As far as I know, this can't be done. There is not much you can do with the file input type.
|
|
#3
|
|||
|
|||
|
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. |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Pre Populating a Input type=file field |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|