help me

C

cyx.thunderfoot

I got a difficult problem about javascript. Can someone please help me?
If I use the <form> tag, and I use the <input type ="text"
name="input"> tag, I can get the value by using
document.formname.input.value , but if I am using <input
type="file" name="file"> to browse for files, how can I get its
value? Anyone who are interested to answer my question please email to
me at (e-mail address removed) , thanks a lot.
 
R

Randy Webb

I got a difficult problem about javascript. Can someone please help me?
If I use the <form> tag, and I use the <input type ="text"
name="input"> tag, I can get the value by using
document.formname.input.value , but if I am using <input
type="file" name="file"> to browse for files, how can I get its
value?

You can't. File inputs are security restricted.

Anyone who are interested to answer my question please email to
me at (e-mail address removed) , thanks a lot.

No thanks. Ask in Usenet, get answered in Usenet.
 
R

RobG

I got a difficult problem about javascript. Can someone please help me?
If I use the <form> tag, and I use the <input type ="text"
name="input"> tag, I can get the value by using
document.formname.input.value , but if I am using <input
type="file" name="file"> to browse for files, how can I get its
value?

Exactly the same way you get the value of any form element:

<form action="">
<input type="file" name="fileSelect">
<input type="button" value="See file selected..." onclick="
alert(this.form.fileSelect.value);
">
</form>


You can't set the value or change it (other than to clear it by
resetting the form).
 

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

Forum statistics

Threads
473,794
Messages
2,569,641
Members
45,353
Latest member
RogerDoger

Latest Threads

Top