Advertisement
Guest User

Untitled

a guest
Aug 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. $('#frm_user_details').formValidation('validate');
  2.  
  3. $('#frm_user_details').formValidation({
  4. framework: 'bootstrap',
  5. fields: {
  6. register_first_name: {
  7. validators: {
  8. notEmpty: {
  9. message: 'Please enter your first name'
  10. }
  11. }
  12. },
  13. register_last_name: {
  14. validators: {
  15. notEmpty: {
  16. message: 'Please enter your last name'
  17. }
  18. }
  19. },
  20. username: {
  21. validators: {
  22. notEmpty: {
  23. message: 'Please enter a username.'
  24. },
  25. remote: {
  26. type: 'POST',
  27. url: '/core/services/validator.php',
  28. message: 'That username is already taken.',
  29. delay: 500
  30. }
  31. }
  32. },
  33. register_password: {
  34. validators: {
  35. notEmpty: {
  36. message: 'The password is required and cannot be empty'
  37. },
  38. identical: {
  39. field: 'register_password_retyped',
  40. message: 'The password and its confirm must be the same'
  41. }
  42. }
  43. },
  44. register_password_retyped: {
  45. validators: {
  46. notEmpty: {
  47. message: 'The confirm password is required and cannot be empty'
  48. },
  49. identical: {
  50. field: 'register_password',
  51. message: 'The password and its confirm must be the same'
  52. }
  53. }
  54. },
  55.  
  56. },
  57. onError: function(e) {
  58. e.preventDefault();
  59. $('#create_account').removeClass('button-disabled');
  60. },
  61. onSuccess: function(e) {
  62. e.preventDefault();
  63. $('#create_account').addClass('button-disabled');
  64. THIS.services.submitHandler();
  65. }
  66. }
  67. });
  68.  
  69. $(formSelector).formValidation({
  70. live : disabled,
  71. //other properties
  72.  
  73. $(document).ready(function() {
  74. $('<your_selector>').formValidation({
  75. live : 'disabled'
  76. });
  77. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement