Hi, Atse
Please see the code bellow. It uses customized button, you can also use
an image or other HTML element to browse files.
There is one difference with this code and plain type=file field -
client must select file from browse window, cannot copy full path to the
text field.
Antonin
See Pure/Huge ASP upload (
http://www.pstruh.cz) to accept uploaded file
in ASP :-)
<HTML>
<HEAD>
<TITLE></TITLE>
<Script Language='Javascript'>
function validateFile()
{
document.frm.Image.click();
var sTmpString = new String(document.frm.Image.value);
var iPos = sTmpString.lastIndexOf("\\");
document.frm.txt.value = sTmpString.substring(iPos+1,sTmpString.length);
}
</Script>
</HEAD>
<BODY>
<form name="frm">
<input type="file"
name="Image" size="20"
onChange="validateFile();" style="visibility:hidden;">
<input type="text" name="txt">
<input type="button" value="Browse ..."
onMouseDown="validateFile();">
</form>
</BODY>
</HTML>
"atse" <du******@yahoo.com> wrote in message
news:oo**********************@news01.bloor.is.net. cable.rogers.com...
Hi,
In the file field <input type="file" name="file1">, can I modify the
button "Browse..."?
I want to hide the file field but show a button like "Open". When I click
on this button, it catches a file, and use onchange even to upload this file.
thanks for any idea.
Atse