Form表单里的BUTTON的type='submit'和'button'的区别
来源:互联网 发布:人民银行工资待遇 知乎 编辑:程序博客网 时间:2024/06/07 16:26
1.submit 用于提交表单时 使用 onsubmit=”“
<form class="form-horizontal" onsubmit="checkform()"> <div class="control-group"> <label class="control-label" for="inputEmail">Email</label> <div class="controls"> <input type="text" id="inputEmail" placeholder="Email"> </div> </div> <div class="control-group"> <label class="control-label" for="inputPassword">Password</label> <div class="controls"> <input type="password" id="inputPassword" placeholder="Password"> </div> </div> <div class="control-group"> <div class="controls"> <label class="checkbox"> <input type="checkbox"> Remember me </label> <button type="submit" class="btn">Sign in</button> </div> </div> </form>
2.button时使用 onclick()方法
<form class="form-horizontal" > <div class="control-group"> <label class="control-label" for="inputEmail">Email</label> <div class="controls"> <input type="text" id="inputEmail" placeholder="Email"> </div> </div> <div class="control-group"> <label class="control-label" for="inputPassword">Password</label> <div class="controls"> <input type="password" id="inputPassword" placeholder="Password"> </div> </div> <div class="control-group"> <div class="controls"> <label class="checkbox"> <input type="checkbox"> Remember me </label> <button type="button" onclick="checkform()" class="btn">Sign in</button> </div> </div> </form>
<script type="text/javascript"> function checkform(){ a=$("#inputEmail").val(); if(a==""){ alert('1'); } } </script>
0 0
- Form表单里的BUTTON的type='submit'和'button'的区别
- type='button'和'submit'的区别
- type="button"和type="submit"的区别
- type="button"和type="submit"的区别
- type="button"和type="submit"的区别
- type="button"和type="submit"的区别
- type="button"和type="submit"的区别
- HTML <button> 和 input type=“button”的区别 / input type="submit" 和"button"的区别
- HTML <button> 和 input type=“button”的区别 / input type="submit" 和"button"的区别
- form表单的提交方式:submit和button.
- 总结:FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- 总结:FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- 总结:form中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- FORM中使用onSubmit="return false"防止表单自动提交,以及submit和button提交表单的区别
- submit 和 button的区别
- HDU 2852 KiKi's K-Number(树状数组)
- C#调用cmd用ffmpeg实现视频截图,图片使用后删除
- Leetcode 355. Design Twitter (Medium) (cpp)
- SSH整合
- HDU 1097 快速幂取余(C语言)
- Form表单里的BUTTON的type='submit'和'button'的区别
- 软考之路(一)---数据结构
- [又值奥运季] 2016年里约奥运会--8月17日赛事
- Myeclipse打开出现:Could not create the view: An unexpected exception was thrown
- Python-堆栈
- UVA____10200
- 并查集
- [leetcode] 77. Combinations
- 软考之路(二)---操作系统