Help needed with htmlinputfile controls

R

Robert Hanson

Hi All,

I am looking for help with getting the Value property from a
htmlinputfile control when the user selects the Submit button on my
form. I need to gather the file name only and not perform a File Upload
procedure.

Thanks in advance,

Bob Hanson
Centare Group Ltd.
 
V

Vidar Petursson

Hi

No problem reading it but you can't modify it
<form>
<input type="file" onchange="doIt(this)">
<input type="text" name="myInput">
</form>

If you want to reset it after getting the filename you can
do a reset
function doIt(e){
var sFile = e.value;
e.form.reset();
e.form.myInput.value = sFile;
}

--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/
http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground: http://213.190.104.211/ ( IE 5.5+ only )

No matter where you go there you are
==============================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top