summaryrefslogtreecommitdiff
path: root/templates/base.html
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2011-03-04 23:59:48 +0100
committerLeif Johansson <leifj@sunet.se>2011-03-04 23:59:48 +0100
commit9e23094460e43806d1ae2ef370e73c95ba917a24 (patch)
tree448b45ab5554626ebe2715530fe8673d0144ca16 /templates/base.html
parent7ca77e22ed201c859ac6d3ed7a97624a9c965ea9 (diff)
adding users now has custom validation
Diffstat (limited to 'templates/base.html')
-rw-r--r--templates/base.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/base.html b/templates/base.html
index bb59dda..64024e4 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -40,6 +40,20 @@
$(input).addClass("ui-state-default");
}
});
+
+ function validUser(value,element) {
+ var valid = false;
+ $.ajax({
+ url: "/user/info/"+value+".json",
+ async: false,
+ dataType: 'json',
+ success: function (json) {
+ valid = true;
+ }
+ });
+ return valid;
+ }
+ $.validator.addMethod("validUser", validUser, "Please enter a valid user.");
});
</script>
{% block js %}{% endblock %}