Currently when the user select a file, it gets directly uploaded into Parse. I have added now couple input text field such as name of individual, address that I would want to be
You have "documentFileUpload" twice:
Change:
To:
Edit
To answer your comment about the recording of the UserId and Address fields, please see the following code. I changed the file upload binding to the button and bound the click event. This will fix your file uploading on selection.
Also, added the id's user_id, and address to allow jQuery to get the values from those fields:
$('#documentFileUploadButton').bind("click", function (e) {
var fileUploadControl = $("#documentFileUpload")[0];
var file = fileUploadControl.files[0];
var name = file.name; //This does *NOT* need to be a unique name
var parseFile = new Parse.File(name, file);
var user_id = $('#user_id').val();
var address = $('#address').val();
parseFile.set('UserId', user_id);
parseFile.set('Address', address);
parseFile.save().then(
function () {
saveDocumentUpload(parseFile);
},
function (error) {
alert("error");
}
);
});
And then: