Bootstrap Validator 表单验证

网友投稿 192 2023-07-10


Bootstrap Validator 表单验证

在线演NiiRfCP示地址:http://shouce.ren/study/api/s/jq--BootstrapValidator--index.html

使用方法,代码如下所示:

1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

16.

17.

18.

19. (YYYY/MM/DD)

20.

21.

22.

23.

24.

25.

26.

27.

28.

29.

30.

1.$('#defaultForm').bootstrapValidator({

2. message: 'This value is not valid',

3. feedbackIcons: {

4. valid: 'glyphicon glyphicon-ok',

5. invalid: 'glyphicon glyphicon-remove',

6. validating: 'glyphicon glyphicon-refresh'

7. },

8. fields: {

9. username: {

10. message: 'The username is not valid',

11. validators: {

12. notEmpty: {

13. message: 'The username is required and cannot be empty'

14. },

15. stringLength: {

16. min: 6,

17. max: 30,

18. message: 'The username must be more than 6 and less than 30 characters long'

19. },

20. regexp: {

21. regexp: /^[a-zA-Z0-9_\.]+$/,

22. message: 'The username can only consist of alphabetical, number, dot and underscore'

23. },

24. remote: {

25. url: 'remote.php',

26. message: 'The username is not available'

27. },

28. different: {

29. field: 'password',

30. message: 'The username and password cannot be the same as each other'

31. }

32. }

33. },

34. email: {

35. validators: {

36. emailAddress: {

37. message: 'The input is not a valid email address'

38. }

39. }

40. },

41. }

42.});

以上所述是给大家介绍的Bootstrap Validator 表单验证的全部叙述,希望对大家有所帮助,如果大家想了解更多内容敬请关注我们!


版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:深入介绍Java对象初始化
下一篇:自己动手写一个java版简单云相册
相关文章

 发表评论

暂时没有评论,来抢沙发吧~