We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b14e3dd commit 744e302Copy full SHA for 744e302
1 file changed
static/secr-static/js/utils.js
@@ -214,12 +214,15 @@ $(document).ready(function() {
214
// validate form upload form before uploading file
215
if ($('#upload_materials_form').length) {
216
$('#upload_materials_form').submit(function() {
217
- var x=$('#id_slide_name').val();
218
- if (x==null || x=="")
+ var name=$('#id_slide_name').val();
+ var type=$('#id_material_type').val();
219
+ if (type=="slides" && (name==null || name==""))
220
{
221
$('#id_slide_name').before('<ul class="errorlist"><li>This field is required.</li></ul>');
222
return false;
223
+ } else {
224
+ return true;
225
}
226
});
- }
227
+ }
228
0 commit comments