社区
JavaScript
帖子详情
【问】
的问题
冷俊
2013-11-06 09:53:24
<input type="image" name="submit" src="img/zhuce.png"style="margin-left: 80px;" onclick="return check();" />
想通过check方法验证再提交,结果自动提交了。我在check方法里加了return false,还是自动提交了?
<input type="image" name="submit" src="img/zhuce.png"style="margin-left: 80px;" onclick="check();return false;" />这样能拦截提交,但是验证成功了也要被拦截。急求解决方法,新人分不多请笑纳
...全文
121
4
打赏
收藏
【问】<input type="image" />的问题
想通过check方法验证再提交,结果自动提交了。我在check方法里加了return false,还是自动提交了? <input type="image" name="submit" src="img/zhuce.png"style="margin-left: 80px;" onc
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
冷俊
2013-11-06
打赏
举报
回复
<input type="image" name="submit" src="img/zhuce.png"style="margin-left: 80px;" onclick="return check();" />
冷俊
2013-11-06
打赏
举报
回复
不行 还是直接提交了 我把javascript代码发上来再帮我看看吧 谢谢 var message =""; function check(){ var name = document.getElementById("name").value; return checkIsNull(name,"message"); } function checkIsNull(value,messageSpan){ var b = ""; message=""; var redata = /\t/; if(value.length==0 || value.value==""||redata.test(value)==true){ message = "不能为空"; b=false; }else { b=true; } document.getElementById(messageSpan).innerHTML = message; return b; }
lyf1991a
2013-11-06
打赏
举报
回复
怎么我试了没问题啊
Andy__Huang
2013-11-06
打赏
举报
回复
try this: onclick="if check() return true; else return false;"
html <
input
type
=file>上传文件时,accept属性值汇总,支持文件格式,限制文件格式,限制上传图片的格式
一、示例标签1: <
input
type
="file" accept="
image
/*" /> accept属性说明:
image
表示图片,*表示支持所有格式的图片文件。 二、示例标签2: <
input
type
="file"accept="audio/mp4,video/mp4" class="uploadVideo"/> 多种格式,以逗号分隔。 前缀说明: text:文本文件。如格式:txt、csv、css、html,能直接使用记事本打开的......
<
input
type
="
image
">图片按钮具有提交功能
直接使用<
input
type
="
image
">即可,此标签放置在<form>标签内就具有提交功能,如果不在<form>标签内,则可以使用<
input
type
="
image
" onClick = "formName.submit()">方式提交。<
input
type
="
image
">说明:
INPUT
type
=
image
元素 | i...
<
input
type
="
image
">标签引发的form表单自动提交
<
input
type
="
image
">标签引发的form表单自动提交
问
题
今天遇到一个
问
题
,在form表单中使用了两个<
input
type
="
image
">标签,form表单会自动提交:
<
input
id="button1" sr
<
input
type
="
image
"> 和
用法区别
和 用法区别 w3c定义如下:
Image
定义图像形式的提交按钮。 必须把 src 属性 和 alt 属性 与 结合使用。
input
type
="
image
" src="submit.gif" alt="Submit" /> 一般的 写一个表单提交用到图片:两种代码。 1.
input
type
="
image
" src="xxx.gif
<
input
type
="file">设置的onchange只能执行一次的解决方案
<
input
type
="file">设置的onchange只能执行一次的解决方案
JavaScript
87,991
社区成员
224,684
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章