From 510fd216e10bc34b7c20637dcad4a975518475dc Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Sat, 16 May 2015 14:29:31 -0700 Subject: [PATCH] light validation fo category --- js/funcs.js | 7 +++++++ templates/pages/add.html | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/js/funcs.js b/js/funcs.js index 3717a40..bbef664 100644 --- a/js/funcs.js +++ b/js/funcs.js @@ -14,4 +14,11 @@ $(document).ready( function () { window.close(); }, 500); } + + $("form.form-add").submit( function(e) { + if ( $(".add-category").val() == -1) { + e.preventDefault(); + $(".add-category-col").addClass("has-error"); + } + }); }); diff --git a/templates/pages/add.html b/templates/pages/add.html index a9d18d5..28e3faa 100644 --- a/templates/pages/add.html +++ b/templates/pages/add.html @@ -6,15 +6,16 @@
Link:
Title:
-
Category:
- + {{range $category := .categories}} {{template "option-category" $category}} {{end}}
Notes:
-
+