106. 107. 108.
109. 110. 111. 112. 113. 114.
115. 116. 117. 118. $(document).ready(function(){119. // Generate a simple captcha120. function randomNumber(min, max){121. (()*(max - min +1)+ min);122. };123. function generateCaptcha(){124. $('#captchaOperation').html([randomNumber(1,50),'+', randomNumber(1,50),'='].join(' '));125. };126. generateCaptcha();127. $('#LoginG')128. .bootstrapValidator({129. //message: 'This value is not valid',130. feedbackIcons:{131. valid:'glyphicon glyphicon-ok',132. invalid:'glyphicon glyphicon-remove',133. validating:'glyphicon glyphicon-refresh'134. },135. fields:{136. Username:{137. message:'The username is not valid',138. validators:{139. notEmpty:{140. message:'供货商账户不能为空'141. },142. stringLength:{143. min:5,144. max:10,145. message:'供货商账号长度 5-10'146. },147. /*remote: {148. url: '',149. message: 'The username is not available'150. },*/151. regexp:{152. regexp:/^[a-zA-Z0-9_.]+$/,153. message:'只接受数字和字母 '154. }155. }156. },157. Password:{158. validators:{159. notEmpty:{160. message:'密码不能为空'161. }162. }163. },164. captcha:{165. validators:{166. callback:{167. message:'验证码错误',168. callback:function(value, validator){169. var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0])+ parseInt(items[2]);170. return value == sum;171. }172. }173. }174. }175. }176. })177. .on('',function(e){178. var $form = $(),179. bootstrapValidator = $('bootstrapValidator');180. if(!dField('captcha')){181. // The captcha is not valid182. // Regenerate the captcha183. generateCaptcha();184. }185. });186. });187. 188. 189. $(document).ready(function(){190. // Generate a simple captcha191. function randomNumber(min, max){192. (()*(max - min +1)+ min);193. };194. function generateCaptcha(){195. $('#captchaOperation2').html([randomNumber(1,50),'+', randomNumber(1,50),'='].join(' '));196. };197. generateCaptcha();198. $('#LoginS')199. .bootstrapValidator({200. //message: 'This value is not valid',201. feedbackIcons:{202. valid:'glyphicon glyphicon-ok',203. invalid:'glyphicon glyphicon-remove',204. validating:'glyphicon glyphicon-refresh'205. },206. fields:{207. Username2:{208. message:'The username is not valid',209. validators:{210. notEmpty:{211. message:'供货商账户不能为空'212. },213. stringLength:{214. min:5,215. max:10,216. message:'供货商账号长度 5-10'217. },218. /*remote: {219. url: '',220. message: 'The username is not available'221. },*/222. regexp:{223. regexp:/^[a-zA-Z0-9_.]+$/,224. message:'只接受数字和字母 '225. }226. }227. },228. Password2:{229. validators:{230. notEmpty:{231. message:'密码不能为空'232. }233. }234. },235. captcha2:{236. validators:{237. callback:{238. message:'验证码错误',239. callback:function(value, validator){240. var items = $('#captchaOperation2').html().split(' '), sum = parseInt(items[0])+ parseInt(items[2]);241. return value == sum;242. }243. }244. }245. }246. }247. })248. .on('',function(e){249. var $form = $(),250. bootstrapValidator = $('bootstrapValidator');251. if(!dField('captcha')){252. // The captcha is not valid253. // Regenerate the captcha254. generateCaptcha();255. }256. });257. });258. 259. 260.
2023年6月21日发(作者:)
Bootstrap实现登录校验表单(带验证码) 这个登陆窗⼝是双登陆窗⼝的,对IE8及早期版本不⽀持,可以根据⾃⼰的开发语⾔更换,我这个是asp的,其中的引⽤⽂件可以在⽹络上⾃⾏下载,如找不到可以留下邮箱~!关键代码如下所⽰:1. 2. 3.
4. 5. scm登陆界⾯6. 7. body {8. background-color:#999;9. }10. 11. 12. 13. 14. 15. 16. <% 17. =True
18. sAbsolute=Now()-1
19. s=0
20. ontrol="no-cache"
21. %>22. 23.
24. 37. 38. 39. ******管理系统
40. 41. 42. 43. 44. 45. 供应商登陆46. ⽣产商登陆47. 48. 49. 50. 51. 供应商登陆52. 53. 54. 55. 56. 57. 账号58. 59. 60.
61. 62. 63. 64. 密码65. 66. 67.
68.
69.
请将如下计算结果填⼊⽂本框内:
70. 71. 72. 73. 74. 75.
76. 77. 78. 79. 80. 81. 82. 83. 84. ⽣产商登陆85. 86.
87. 88. 89. 90. 账号91. 92. 93.
94. 95. 96. 97. 密码98. 99. 100.
101.
102.
请将如下计算结果填⼊⽂本框内:
103. 104. 105. 106. 107. 108.
109. 110. 111. 112. 113. 114.
115. 116. 117. 118. $(document).ready(function(){119. // Generate a simple captcha120. function randomNumber(min, max){121. (()*(max - min +1)+ min);122. };123. function generateCaptcha(){124. $('#captchaOperation').html([randomNumber(1,50),'+', randomNumber(1,50),'='].join(' '));125. };126. generateCaptcha();127. $('#LoginG')128. .bootstrapValidator({129. //message: 'This value is not valid',130. feedbackIcons:{131. valid:'glyphicon glyphicon-ok',132. invalid:'glyphicon glyphicon-remove',133. validating:'glyphicon glyphicon-refresh'134. },135. fields:{136. Username:{137. message:'The username is not valid',138. validators:{139. notEmpty:{140. message:'供货商账户不能为空'141. },142. stringLength:{143. min:5,144. max:10,145. message:'供货商账号长度 5-10'146. },147. /*remote: {148. url: '',149. message: 'The username is not available'150. },*/151. regexp:{152. regexp:/^[a-zA-Z0-9_.]+$/,153. message:'只接受数字和字母 '154. }155. }156. },157. Password:{158. validators:{159. notEmpty:{160. message:'密码不能为空'161. }162. }163. },164. captcha:{165. validators:{166. callback:{167. message:'验证码错误',168. callback:function(value, validator){169. var items = $('#captchaOperation').html().split(' '), sum = parseInt(items[0])+ parseInt(items[2]);170. return value == sum;171. }172. }173. }174. }175. }176. })177. .on('',function(e){178. var $form = $(),179. bootstrapValidator = $('bootstrapValidator');180. if(!dField('captcha')){181. // The captcha is not valid182. // Regenerate the captcha183. generateCaptcha();184. }185. });186. });187. 188. 189. $(document).ready(function(){190. // Generate a simple captcha191. function randomNumber(min, max){192. (()*(max - min +1)+ min);193. };194. function generateCaptcha(){195. $('#captchaOperation2').html([randomNumber(1,50),'+', randomNumber(1,50),'='].join(' '));196. };197. generateCaptcha();198. $('#LoginS')199. .bootstrapValidator({200. //message: 'This value is not valid',201. feedbackIcons:{202. valid:'glyphicon glyphicon-ok',203. invalid:'glyphicon glyphicon-remove',204. validating:'glyphicon glyphicon-refresh'205. },206. fields:{207. Username2:{208. message:'The username is not valid',209. validators:{210. notEmpty:{211. message:'供货商账户不能为空'212. },213. stringLength:{214. min:5,215. max:10,216. message:'供货商账号长度 5-10'217. },218. /*remote: {219. url: '',220. message: 'The username is not available'221. },*/222. regexp:{223. regexp:/^[a-zA-Z0-9_.]+$/,224. message:'只接受数字和字母 '225. }226. }227. },228. Password2:{229. validators:{230. notEmpty:{231. message:'密码不能为空'232. }233. }234. },235. captcha2:{236. validators:{237. callback:{238. message:'验证码错误',239. callback:function(value, validator){240. var items = $('#captchaOperation2').html().split(' '), sum = parseInt(items[0])+ parseInt(items[2]);241. return value == sum;242. }243. }244. }245. }246. }247. })248. .on('',function(e){249. var $form = $(),250. bootstrapValidator = $('bootstrapValidator');251. if(!dField('captcha')){252. // The captcha is not valid253. // Regenerate the captcha254. generateCaptcha();255. }256. });257. });258. 259. 260.
本文发布于:2023-06-21,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jquery表单验证
发布评论