From 55cd8529c33bc459ce1bd81d86cf420136f593cc Mon Sep 17 00:00:00 2001 From: kakwa Date: Mon, 2 Nov 2015 23:43:51 +0100 Subject: [PATCH] adding special treatment if field is not required for ppolicy --- resources/static/js/ppolicy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/static/js/ppolicy.js b/resources/static/js/ppolicy.js index 36df342..e67ff29 100644 --- a/resources/static/js/ppolicy.js +++ b/resources/static/js/ppolicy.js @@ -1,6 +1,9 @@ $('#form').validator({ custom: { 'ppolicy': function($el) { + if(! $el.prop('required') && $el.val() == 0){ + return true; + }; var $ret = 'PPolicy error'; $.ajax({ url: '/checkppolicy',