diff --git a/resources/static/js/ppolicy.js b/resources/static/js/ppolicy.js new file mode 100644 index 0000000..36df342 --- /dev/null +++ b/resources/static/js/ppolicy.js @@ -0,0 +1,21 @@ +$('#form').validator({ + custom: { + 'ppolicy': function($el) { + var $ret = 'PPolicy error'; + $.ajax({ + url: '/checkppolicy', + dataType: 'json', + async: false, + data: 'pwd=' + $el.val(), + success: function(data) { + $ret = data; + } + }); + this.options.errors['ppolicy'] = $ret['reason']; + return $ret['match']; + } + }, + errors: { + 'ppolicy': 'PPolicy error', + } +})