郁闷,触发file元素的click()方法后得到的文件无法上传!? <form name=f enctype="multipart/form-data"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <form name=f method="post" enctype="multipart/form-data"> enctype="multipart/form-data"是上传文件必须用的属性。。 可能又是微软给弄的吧网易也是用的他的click()事件吗? 你调onClick做什么用?我在上传时调用过onChange都没有问题啊 呵呵,这个早就发现,原因就不知道了.后来我找到另一种方法<input id=a size=20><button>选择文件</button><div style="position:absolute;top:0;left:-80;width:150;filter:alpha(opacity=0)" ><input type="file" onpropertychange="a.value=this.value" size=33></div> 呵呵,我原来还打算暴露一个“浏览...”按钮出来给人点呢,fason干脆把它给透明了,高,实在是高! <form action=upfile.asp enctype="multipart/form-data"><input type="file" id="upfile" style="width=200px;"><span style="position:relative;left:-80px;width=80;"><input type=button onclick="upfile.click();" value=样式随你设></span><span style="position:relative;left:-80px;"><input type="submit" value="上传"></span></form> 对于上传enctype="multipart/form-data是必须的啊! 这是163的做法,其实也挺漂亮的。实际使用的时候把iframe的宽和高设为0。为了在一个网页里面写完,没有把框架网页写成单独的文件而用了write来生成,实际使用的时候可以用单独的内嵌网页文件。<iframe name=fileList></iframe><SCRIPT LANGUAGE="JavaScript"><!--fileList.document.write("<form name=f action='http://www.csdn.net'>");fileList.document.write("<input type=file name=f0>");fileList.document.write("<input type=file name=f1>");fileList.document.write("<input type=file name=f2>");fileList.document.write("</form>");//--></SCRIPT><BR><input name="file0"><input type="button" value="浏览..." onclick="fileList.document.f.f0.click();file0.value=fileList.document.f.f0.value"><BR><input name="file1"><input type="button" value="浏览..." onclick="fileList.document.f.f1.click();file1.value=fileList.document.f.f1.value"><BR><input name="file2"><input type="button" value="浏览..." onclick="fileList.document.f.f2.click();file2.value=fileList.document.f.f2.value"><BR><input type=button onclick="fileList.document.f.submit();" value="提交"> woyingjie(killerj.style.display == "none";)(隐身中..........) :你没给file控件name属性,而没有name属性的控件是不提交的。 js 如何删除数组元素 google浏览器解析xml 一个 js问题 请教下 很简单?提示我image1Id未定义? 求一时间正则表达式~~~~~~~~~~~~~~马上揭帖~~ options[selectedIndex].value表示下拉列表的值,那下拉列别的标签用什么来表示 这样漂亮的效果是怎么做的?? 梅花雨日历控件2.0新鲜出炉!大副改观的界面!全新的iframe载体,不再被select挡住! 关于“JSP+ext超强仿QQ聊天系统 WebQQ”为什么登录不了的 jQuery的wrap方法不兼容ie7 问一个关于css的问题 javascript的另类下拉菜单
我在上传时调用过onChange都没有问题啊
<div style="position:absolute;top:0;left:-80;width:150;filter:alpha(opacity=0)" >
<input type="file" onpropertychange="a.value=this.value" size=33>
</div>
<input type="file" id="upfile" style="width=200px;">
<span style="position:relative;left:-80px;width=80;">
<input type=button onclick="upfile.click();" value=样式随你设>
</span>
<span style="position:relative;left:-80px;">
<input type="submit" value="上传">
</span>
</form>
为了在一个网页里面写完,没有把框架网页写成单独的文件而用了write来生成,实际使用的时候可以用单独的内嵌网页文件。<iframe name=fileList></iframe>
<SCRIPT LANGUAGE="JavaScript">
<!--
fileList.document.write("<form name=f action='http://www.csdn.net'>");
fileList.document.write("<input type=file name=f0>");
fileList.document.write("<input type=file name=f1>");
fileList.document.write("<input type=file name=f2>");
fileList.document.write("</form>");
//-->
</SCRIPT>
<BR>
<input name="file0">
<input type="button" value="浏览..." onclick="fileList.document.f.f0.click();file0.value=fileList.document.f.f0.value">
<BR>
<input name="file1">
<input type="button" value="浏览..." onclick="fileList.document.f.f1.click();file1.value=fileList.document.f.f1.value">
<BR>
<input name="file2">
<input type="button" value="浏览..." onclick="fileList.document.f.f2.click();file2.value=fileList.document.f.f2.value">
<BR>
<input type=button onclick="fileList.document.f.submit();" value="提交">