"Hywel Jenkins" <hy**********@hotmail.com> wrote in message
news:MP************************@news.individual.ne t...
In article <41**********@127.0.0.1>, ti*********@brewersmarine.com
says... I have a form that asks the user to upload a file. I have a field on
this
form and I want to re-populate this form if it do not pass a
validation
function. All other fields let me set the VALUE. I understand that
the
"file" input type is different.
How can I re-populate the file name in this type of field. I have
tried the
following statement but it does not work ...
<input type="file" name="datafile2" value="<c:out
value="${param.datafile2}"
/>" size="40">
Any ideas?
Although the HTML spec. permits pre-population of the value field,
most
browsers disallow this for security reasons.
Here is my suggestion:
< if (param.datafile2 contains a value) then >
Selected file: <span style="font-family:monospace;">="<c:out
value="${param.datafile2}" /></span> (copy/paste this into the following
input)
< end if >
File to be uploaded: <input type="file" name="datafile2" size="40">
This way, users don't have to browse for the file again, they can simply
copy/paste the value they see into the input. It's more cumbersome than
populating the <input ... value="...">, but that's the price you pay for
using a browser as your UI.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq