Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. $('#defaultForm').bootstrapValidator({
  2. live: 'enable',
  3. submitted: 'enable',
  4. message: 'This value is not valid',
  5. fields: {
  6. brand_name: {
  7. validators: {
  8. notEmpty: {
  9. message: 'The brand name is required and cannot be empty'
  10. }
  11. }
  12. },
  13. brand_slug: {
  14. validators: {
  15. notEmpty: {
  16. message: 'The brand slug is required and cannot be empty'
  17. }
  18. }
  19. }
  20. }
  21. });
  22.  
  23. // Validate the form manually
  24. $('#validateBtn').click(function() {
  25. $('#defaultForm').bootstrapValidator('validate');
  26. });
  27.  
  28. $('#resetBtn').click(function() {
  29. $('#defaultForm').data('bootstrapValidator').resetForm(true);
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement