Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. $('#addbarform').validate({
  2. rules: {
  3. barname: {
  4. required: true,
  5. minlength: 2,
  6. remote: {
  7. url: "2011-content/includes/checkbarname.php",
  8. data: {
  9. address: function() {
  10. return $('#address').val();
  11. },
  12. barname: function() {
  13. return $('#barname').val();
  14.  
  15. }
  16. }
  17. }
  18. },
  19. address: {
  20. required: true,
  21. remote: {
  22. url: "2011-content/includes/checkbarname.php",
  23. data: {
  24. barname: function() {
  25. return $('#barname').val();
  26.  
  27. },
  28. address: function() {
  29. return $('#address').val();
  30.  
  31. }
  32. }
  33. }
  34. }
  35. },
  36. messages: {
  37. barname: {
  38. remote: 'This bar name already exists at this address.'
  39. },
  40. address: {
  41. remote: 'This bar name already exists at this address.'
  42. }
  43. }
  44. });
  45.  
  46. $('#barname').blur(function () {
  47. if ($('#barname').is(".valid") && ($('#address').is(".error"))) {
  48. $("#address").valid();
  49. }
  50. });
  51.  
  52. $('#address').blur(function () {
  53. if ($('#barname').is(".error") && ($('#address').is(".valid"))) {
  54. $("#barname").valid();
  55. }
  56. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement