From 744e3021598da3abd7393d0854ada38f9976a202 Mon Sep 17 00:00:00 2001 From: Ryan Cross Date: Tue, 30 Jul 2013 14:57:37 +0000 Subject: [PATCH] fix bug with upload form validation - Legacy-Id: 5922 --- static/secr-static/js/utils.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/secr-static/js/utils.js b/static/secr-static/js/utils.js index 65bb513a9..1705fdd8c 100644 --- a/static/secr-static/js/utils.js +++ b/static/secr-static/js/utils.js @@ -214,12 +214,15 @@ $(document).ready(function() { // validate form upload form before uploading file if ($('#upload_materials_form').length) { $('#upload_materials_form').submit(function() { - var x=$('#id_slide_name').val(); - if (x==null || x=="") + var name=$('#id_slide_name').val(); + var type=$('#id_material_type').val(); + if (type=="slides" && (name==null || name=="")) { $('#id_slide_name').before(''); return false; + } else { + return true; } }); - } + } });