daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top