<input type="file" name="blogrollimage" onchange="setBlogrollImageName(this)" txlFillIn="isNotNull" title="链接图片"> <script type="text/javascript"> function setBlogrollImageName(basicfile){ document.getElementById("blogrollimagename").value=basicfile.value; } </script> input的时候把onchange="setBlogrollImageName(this)"