| Author |
reset the value of the file input path
|
Calvin Kong
Ranch Hand
Joined: Jul 02, 2003
Posts: 37
|
|
Hi, I have a question about setting the value (to empty string, or anything) of the file input path. I was thinking it worked as the same way as a text field, but it's not. The value is not changed. So is there any trick to do that with the <input type="file" >? Thanks a lot! Calvin
|
Cal<br />SCJP,SCWCD,SCBCD
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
This might do it.... document.formName.elementName.reset();
|
 |
Calvin Kong
Ranch Hand
Joined: Jul 02, 2003
Posts: 37
|
|
This works, but is there any way other than that? Since reset() will clear everything in the form. Is there any way that I can reset only the file upload field? Thanks a lot. Calvin
|
 |
Yuriy Fuksenko
Ranch Hand
Joined: Feb 02, 2001
Posts: 413
|
|
|
Create your own function that will go through the code, remember what was selected in each element, than do "reset" on form, and restore values.
|
 |
 |
|
|
subject: reset the value of the file input path
|
|
|