Guest User

Untitled

a guest
Oct 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Index: javascript/odesk/plugins/validation/rules/beneName.js
  2. ===================================================================
  3. --- javascript/odesk/plugins/validation/rules/beneName.js (revision 4178)
  4. +++ javascript/odesk/plugins/validation/rules/beneName.js (working copy)
  5. @@ -1,16 +1,16 @@
  6. (function($){
  7. -var _acce = '';
  8. var _matched = false;
  9.  
  10. -$(document).ready(function() {
  11. - _acce = $('#account').val();
  12. -});
  13. -
  14. $.validator.addMethod('beneName', function(value, element, param) {
  15. + var acce = null;
  16. value = $.trim(value);
  17. + if (undefined != $(element).attr('account')) {
  18. + str = $.trim($(element).attr('account')).replace(/\D+/g, '');
  19. + acce = 0 < str.length ? str : acce;
  20. + }
  21. $.ajax({
  22. type: 'post',
  23. - url: '/api/finance/v1/compliance/' + _acce + '/' + value + '.json',
  24. + url: '/api/finance/v1/compliance/' + acce + '/' + value + '.json',
  25. success: function(data) {
  26. _matched = data.result;
  27. }
Add Comment
Please, Sign In to add comment