diff --git a/cadasta/core/static/js/file-upload.js b/cadasta/core/static/js/file-upload.js index 0841d58e1..76e3a70d7 100644 --- a/cadasta/core/static/js/file-upload.js +++ b/cadasta/core/static/js/file-upload.js @@ -14,6 +14,8 @@ $(function() { $('a.file-link').attr('download', file.name); }); + var name = file.name.substr(0, file.name.lastIndexOf('.')).replace(/_/, " "); + $('input[name="name"][prefill="true"]').val(name); $('input[name="original_file"]').val(file.name); $('input[name="details-original_file"]').val(file.name); diff --git a/cadasta/templates/resources/form.html b/cadasta/templates/resources/form.html index 78f0f2629..82ec98f9e 100644 --- a/cadasta/templates/resources/form.html +++ b/cadasta/templates/resources/form.html @@ -15,7 +15,7 @@
- {% render_field form.name class+="form-control" data-parsley-required="true" data-parsley-sanitize="1" %} + {% render_field form.name class+="form-control" prefill="true" data-parsley-required="true" data-parsley-sanitize="1" %}
{{ form.name.errors }}