rem: var full = self.form.userfile.value; self.form.title.value = full.substring(full.lastIndexOf('/')+1, full.length); 
add: self.form.title.value = self.filepart(self.form.userfile.value); 
context:     this.initform = function () {        var form = FORM({'method':'post', 'id':'uploadform',                         'enctype':'multipart/form-data', 'encoding':'multipart/form-data',                         'action':'upload.php', 'target':''});        appendChildNodes(form,            TABLE(null,            TBODY(null,              TR(null, TH(null, LABEL(null, get_string('destination'))),                TD(null, SPAN({'id':'uploaddest'},self.foldername))),             TR(null, TH(null, LABEL(null, get_string('file'))),                TD(null, INPUT({'type':'file', 'name':'userfile', 'onchange':function () {                    var full = self.form.userfile.value;                    self.form.title.value = full.substring(full.lastIndexOf('/')+1, full.length);                }}))),             TR(null, TH(null, LABEL(null, get_string('title'))),                TD(null, INPUT({'type':'text', 'name':'title'}))),             TR(null, TH(null, LABEL(null, get_string('description'))),                TD(null, INPUT({'type':'text', 'name':'description'}))),             TR(null,TD({'colspan':2, 'id':'uploadformmessage'})),             TR(null,TD({'colspan':2},              INPUT({'name':'upload','type':'button','value':get_string('upload'),                     'onclick':function () { self.sendform(false)}}),              INPUT({'name':'replace','type':'button','value':get_string('replace'),                     'onclick':function () { self.sendform(true); }}),              INPUT({'type':'button','value':get_string('cancel'),'onclick':function () {                   if ($('uploadformmessage')) {                      $('uploadformmessage').innerHTML = '';                  }                  self.form.userfile.value = '';                  self.form.title.value = '';                  self.form.description.value = '';                  hideElement(self.form);                  showElement(self.openbutton);              }}))))));        hideElement(form.replace);        hideElement(form);        return form;    }
meta: 5659	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5659/29d05248c6513493a620fe4d0ea8f1399362593c/uploader.js/buggy/htdocs/artefact/file/js/uploader.js