Upload form of picture preview function
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title> Image upload </title><script> function viewmypic(mypic,imgfile) { if (imgfile.value){ mypic.src=imgfile.value; mypic.style.display=""; mypic.border=1; } } </script> <center> <form> <input name="imgfile" type="file" id="imgfile" size="40" onchange="viewmypic(showimg,this.form.imgfile);" /><br /> </form><img name="showimg" id="showimg" style="display: none;" alt="Preview picture -- toyean. com" src="undefined"/><br/> <div style="display:none"> </div> </center>
Related articles
10 days Learn PHP Day 7 Object Oriented Design Patterns in Flash Z-index problems encountered in IE7 and solutions Yt.cms The setting method of outputting the first picture if there is a picture in the article, and outputting the default picture if there is no picture Text box showing code line number Hand and pointer in css mouse hand cursor