put file name in title if title field is empty

This commit is contained in:
Helmut Merz 2015-04-14 16:37:29 +02:00
parent 13da77de0a
commit 08880e3b91

View file

@ -144,7 +144,11 @@
<metal:upload define-macro="input_fileupload"> <metal:upload define-macro="input_fileupload">
<input type="file" name="field" <input type="file" name="field"
tal:attributes="name name;" /> tal:attributes="name name;"
onchange="if (this.form.title.value == '') {
var value = this.value.split('\\');
this.form.title.value = value[value.length-1];
}" />
</metal:upload> </metal:upload>