1 jQuery.validator.addMethod( "restrictionCode", function(value){
2 var ex = Object.keys(existing);
3 return (value.length > 0 && ex.indexOf(value.toUpperCase()) > -1) ?
6 }, MSG_DUPLICATE_CODE);
8 jQuery.validator.addMethod( "restrictionDisplayText", function(value){
9 var ex = Object.values(existing).map(function(el) {
10 return el.toLowerCase();
12 return (value.length > 0 && ex.indexOf(value.toLowerCase()) > -1) ?
15 }, MSG_DUPLICATE_DISPLAY_TEXT);
17 $(document).ready(function() {
18 KohaTable("restriction_types", {
30 "sPaginationType": "full",
31 "exportColumns": [0,1],
34 $("#restriction_form").validate({
42 restrictionDisplayText: true
47 restrictionCode: MSG_DUPLICATE_CODE
50 restrictionDisplayText: MSG_DUPLICATE_DISPLAY_TEXT