Notes Ninjas Notes Ninjas
Lotus Notes hints, tips, error messages
Multiple file upload controls, which file was in which box?

Hint Short Cut: Add this to your code & documentation to help you find this page.
http://www.notesninjas.com/#MultiUpload or http://www.notesninjas.com/A555F9/nn.nsf/ByAlias/MultiUpload

Multiple file upload controls work well in notes, but how do you know which file was selected in

which field? This bit of code will extract the filenames in to additional fields.


"<script>"+@newline+
" function filenames() {"+@NewLine+
" // code and comments are at
http://www.NotesNinjas.com" + @NewLine+
" // you must have a field called FileX for each upload, so 3 uploads "+@newline+
"// fields File1 File2 File3 "+@newline+
" var filefieldnm;"+@newline+
" var filefieldcount=1;"+@newline+
"for ( i = 0; i < document.forms[0].elements.length; i++ ) { "+@newline+
"   if ( document.forms[0].elements[i].type == 'file') {"+@newline+
"       alert('val:' + document.forms[0].elements[i].value );"+@newline+
"       filefieldnm=eval('document.forms[0].File'+filefieldcount);"+
"      filefieldnm.value=document.forms[0].elements[i].value "+@newline+
"      filefieldcount++;"+@newline+
"   }"+@newline+
"}"+@newline+
"  return false; };  "+@newline+
"</script> "
 

 Jump to:     Notes Tips
    Lotus Notes Index 
  Register for Tips
Previous Lotus Notes Tip 
    Next Lotus Notes Tip
Your company logo here?
Adam Foster
Free Cash Making Web Site
Free Revenue Earning Blog Site
 Free Revenue Earning Newsletter Site   
Free Search Pages Free Web stats
Free Contact Us page
Cheap .com domain names
 Need a website or 
   Lotus Notes
  problem solved?
Adam Foster
man and boy by Tony Parsons
British book of the year 2000. Great book, hard to put down, but I nearly threw it away half way through. You'll know why when you read it.
See at: Amazon.co.uk | Amazon.com |