Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. function checkFormIsCorrect() {
  2. if (!$('div.has-error').length > 0) {
  3. return displayAlertify('confirm',
  4. 'Confirme todos os dados antes de submeter');
  5. }
  6. return false;
  7. }
  8.  
  9. function displayAlertify(message) {
  10.  
  11. /* escopo anterior */
  12.  
  13. alertify.confirm(message, function(e) {
  14.  
  15. /* novo escopo */
  16.  
  17. if (e) {
  18. /* retorna para onde foi chamado */
  19. return true;
  20. } else
  21. /* retorna para onde foi chamado */
  22. return false;
  23. });
  24. }
  25.  
  26. function checkFormIsCorrect() {
  27. if ($('div.has-error').length <= 0) {
  28. displayAlertify('confirm', 'Confirme todos os dados antes de submeter');
  29. }
  30. /* break */
  31. return false;
  32. }
  33.  
  34. function displayAlertify(message) {
  35. alertify.confirm(message, function(e) {
  36. /* submete o formulário */
  37. if (e) $('form')[0].submit();
  38. });
  39. }
  40.  
  41. function checkFormIsCorrect() {
  42. if (!$('div.has-error').length > 0) {
  43. displayAlertify('confirm',
  44. 'Confirme todos os dados antes de submeter');
  45. }
  46. return false;
  47. }
  48.  
  49. function displayAlertify(type, message) {
  50. alertify.confirm(message, function(e) {
  51. if (e) $('form')[0].submit();
  52. e.preventDefault();
  53. });
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement