Closed ajeetksingh closed 8 years ago
You need to use the the setData()
method inside of the onSubmit()
callback function. For example:
var uploader = new ss.SimpleUpload({
button: someBtn,
url: '/uploadUrl',
// Other options...
onSubmit: function() {
var self = this;
self.setData({
test: $("#testValue").val()
});
}
});
The setData()
method sets the value of the data
option. It accepts an object.
Setting the data
option during onSubmit()
allows you to grab the value of an input field at the time the upload was submitted.
How can one transfer the dynamic data to the server. How can I send an value chosen from the dropdown list along with the file:
data: {"test": $("#testValue").val()}
It's working fine for static data passed like this:
data: {"test": "1"}
PS: Assume that I have got an hidden input element whose value has already been set to the data from the dropdown list.