PHP上传文件,如何将上传的文字变为完成

WBOY
Release: 2016-06-20 12:48:44
Original
820 people have browsed it

<form id="upload_form" enctype="multipart/form-data" method="post" action="upload.php" ><input id="img" name="img" type="file" accept="image/*" onChange="fileSelected()" ><input id="img2" name="img2" type="file" accept="image/*" onChange="fileSelected()" ><input type="button" value="上传" id="send" onClick="startUploading()" /></form>
Copy after login


这个是静态页的,我需要将文件上传完后。在这句这里变换为已上传,这句就不可以再点了。不知能不能实现。


回复讨论(解决方案)

上传完成的时候用js来做改变,就改变一下input的value和onclick

上传完成了之后 用javascript 获取button 对象  var btn = document.getElementById("button的id") ; btn.value = "完成"; 然后设置button的value属性就好了

补充楼上:最后设置input属性disabled=‘disabled’,这句就可以不能再点了

这取决于你的 startUploading 函数都做了些什么
在正常流程中,由于你的 form 没有指定 target 属性,提交后表单页已经不存在了,修改按钮文字的需求并不存在。皮之不存毛将焉附
虽然你可以 后退 到表单页,为下一轮上传做准备,不让上传那要这个表单干什么?

是可以实现的。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!