Javascript:
<script type="text/javascript">
function getStats(fName){
fullName = fName;
shortName = fullName.match(/[^\/\\]+$/);
document.forms.fileForm.dispName.value = shortName
}
</script>
HTML:
<form name='fileForm'>
Choose a File: <input type="file" name="isIMG" onChange="getStats(this.value)">
<br>
File Name: <input name='dispName' size=20>
<br>
<input type=submit value="Submit Form">
</form>
Let me know if you have other questions.
--------------------------
Answer:- Javascript:
<script type="text/javascript">
function getStats(fName){
fullName = fName;
shortName = fullName.match(/[^\/\\]+$/);
document.forms.fileForm.dispName.value = shortName
}
</script>
HTML:
<form name='fileForm'>
Choose a File: <input type="file" name="isIMG" onChange="getStats(this.value)">
<br>
File Name: <input name='dispName' size=20>
<br>
<input type=submit value="Submit Form">
</form>
Let me know if you have other questions.
Related Questions
vitam
html question
Please go to website "clubcastropignano.com" on the left hand side please click on "event calendar" note nothing shows up. Please see if you can help me. And thank you in advance, Thank you so much.
khusbo
why codes are so difficult to read
all the programming and web design looked interesting to me so i looked up on it.
so if they are differnt can you explain to me why?
Maihan
Load External Page
HI,
I want to load external page into my website,
I want this http://acbar.org/job_search.php page appear as frame in my webpage,
any help will be really appreciated.
rival
Submit Button
I actually have two questions about a submit button for a feedback form. One, whenever I test my form and hit submit, it just opens my email software, in this case AOL. I need to know a way so that it automatically sends me the message. My other question is that do you know how to get that same submit button to open another page, say a thankyou page, and submit the message. Thank you, I hope you have the answer I am looking for. BTW, the code I am using is this: <form action="MAILTO:musikkreator35@gmail.com" method="post" enctype="text/plain"> --then my form stuff-- <input type="submit" value="Send" method="post">. Thanks!
nazia
Download from a html document
Hi, I am creating a music website with html and I would like my visitors to be able to download my music if they liked it. Do you know the html code that can do that? Thanks in advance, I hope you have an answer.