Skip to content

Commit 744e302

Browse files
committed
fix bug with upload form validation
- Legacy-Id: 5922
1 parent b14e3dd commit 744e302

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

static/secr-static/js/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,15 @@ $(document).ready(function() {
214214
// validate form upload form before uploading file
215215
if ($('#upload_materials_form').length) {
216216
$('#upload_materials_form').submit(function() {
217-
var x=$('#id_slide_name').val();
218-
if (x==null || x=="")
217+
var name=$('#id_slide_name').val();
218+
var type=$('#id_material_type').val();
219+
if (type=="slides" && (name==null || name==""))
219220
{
220221
$('#id_slide_name').before('<ul class="errorlist"><li>This field is required.</li></ul>');
221222
return false;
223+
} else {
224+
return true;
222225
}
223226
});
224-
}
227+
}
225228
});

0 commit comments

Comments
 (0)