Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. $(document).ready(function()
  2. {
  3. $('#fieldIconsForm').bootstrapValidator(
  4. {
  5. feedbackIcons:
  6. {
  7. valid: 'glyphicon glyphicon-ok',
  8. invalid: 'glyphicon glyphicon-remove',
  9. validating: 'glyphicon glyphicon-refresh'
  10. },
  11. fields:
  12. {
  13. name:
  14. {
  15. feedbackIcons: 'false',
  16. validators:
  17. {
  18. notEmpty:
  19. {
  20. message: 'Name is required'
  21. }
  22. }
  23. },
  24. password:
  25. {
  26. feedbackIcons: false,
  27. validators:
  28. {
  29. notEmpty:
  30. {
  31. message: 'Password is required'
  32. }
  33. }
  34. }
  35. }
  36. }).on('success.form.bv', function(e)
  37. {
  38. e.preventDefault();
  39. checklogindetails();
  40. });
  41. });
  42.  
  43. function checklogindetails()
  44. {
  45.  
  46. $captcha = $( '#recaptcha' );
  47. response = grecaptcha.getResponse();
  48.  
  49. if (response.length === 0) {
  50. alert('please verify yourself');
  51. }
  52.  
  53. else
  54. {
  55. var username = $("#name").val().trim();
  56. var password = $("#password").val().trim();
  57. if (username === 'admin' && password === 'admin')
  58. {
  59. alert('Valid Credentials');
  60. }
  61. else
  62. {
  63. alert('Invalid Credentials');
  64. return false;
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement