Form upload event handler wont work


#1

I have a page and in it i have several form upload fields. I dont want to do multi upload but rather upload one document at a time and grab their paths separately.From he code i have seen and tested and seen it work,the change event is hooked to the form and not the individual upload field like

<form class="formclass">
<input type="file" class="classhere"/>
</form>

so to upload file using this form i would do

   	'change .formclass': function(event, template) {
     alert('we are here');
    FS.Utility.eachFile(event,function(file){

        var fileObj=new FS.File(file);

        Uploads.insert(fileObj,function(err){
			
            var lspath = 'awesomepath';
			var au = Meteor.absoluteUrl();
			var au = au.replace(/\/$/, "");
			localStorage.setItem("one", lspath);
			var ls = localStorage.getItem("one");
			$(".onepath").val(ls);									
        });

		})
  }

Since i have several form upload fields in the same form,how can i change my code to respond to events identified by the class of the individual form upload fields?.


#2

The problem was with my autoform schema.This code

		uod1: {
    type: String,
    label: "Document 1",
	optional: true,
	autoform: {
      afFieldInput: {
	  class:"one",
        type: "cfs-file",
        collection: "uploads"
      }
    }
  },

produces this html

<input type="file" class="cfsaf-hidden" data-cfs-collection="uploads" data-schema-key="uod1">

<input type="text" readonly="" class="one cfsaf-field form-control" name="uod1" id="Yfwq29qW6a4JEn5BP" placeholder="Click to upload a file or drop it here">

Thats not where i was expecting class=“one” to end up,but it did.So i solved it by using data*

like so

'change [data-schema-key="uod1"]': function(event, template) {