<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="gb2312" lang="gb2312"> <head> <title> 上傳的時候<input type="file">中用圖片代替瀏覽按鈕 </title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta name="title" content="" /> <meta name="author" content="活靶子,huobazi" /> <meta name="subject" content="" /> <meta name="language" content="gb2312" /> <meta name="keywords" content="" /> <meta name="Copyright" content="" /> <meta name="robots" content="all" /> <script language="javascript" type="text/javascript"> function fn_browse() { document.test_form.browse.click(); document.test_form.file.value = document.all.test_form.browse.value; } </script> </head> <body> <form name="test_form" method="post" ENCTYPE="multipart/form-data" onsubmit="alert(document.test_form.browse.value);" /> <input type="file" name="browse" style="display:none;" /> <input type="text" name="file" /> <a href="javascript:fn_browse();"> <img name="btn" src="browse.gif" border="0" /> <br /> <br /> <input type="submit" name="提交表單" /> </form> </body> </html>