input type="reset"标签失效

本文详细介绍了如何将<input type=reset>按钮正确地放置在HTML表单中,确保用户能够轻松重置表单数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

应该把<input type="reset">放在<form>表单中。

<form>

<input type="reset">

</form>

转载于:https://www.cnblogs.com/ningvsban/archive/2012/10/31/2747669.html

<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <form id="formal" name="formal" method="post" enctype="multipart/form-data" action="upfile_ok.php"> <table width="356" border="1" align="center"> <tr> <td width="184">请上传您的个人形象</td> <td width="263"><label> <input type="file" name="upfiles" id="upfiles" /> </label></td> <td width="125"><label> <input type="submit" name="submit" id="submit" value="上传" /> <input type="reset" name="reset" id="reset" value="重置" /> </label></td> </tr> </table> </form> </body> </html> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <?php if($_POST["submit"]=="上传"){ $f_path="./upload\\"; $f_name=$_FILES['upfiles']['name']; $c_name=strstr($f_name,"."); if($c_name!=".jpg"){ echo "文件格式不符合要求"; }else if($_FILES['upfiles']['tmp_name']){ move_uploaded_file($_FILES['upfiles']['tmp_name'],$f_path.$_FILES['upfiles']['name']); echo "图片上传成功!"; echo "<br>"; echo "您的个人形象是:"."<img src'".$f_path.$_FILES['upfiles']['name']."'>"; }else{ echo "上传图片失败!"; } } ?> </body> </html> 我这两个文件代码生成之后在html网页中能显示上传文件,上传后显示上传成功,但是不能显示出我上传的图片,帮我分析一下原因
03-22
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值