I need to create a drag and drop page. I am currently using "Dropzone" plugin. In my client I have the following html:
Here I select a Value from an input:
<div class="form-group">
<label for="selectMarca" class="col-sm-3">Selecione o tipo de Comerciantes a Importar</label>
<select class="form-control" id="selector">
<option value=0>Value0</option>
<option value=1>Value1</option>
<option value=2>Value2</option>
<option value=3>Value3</option>
</select>
</div>
Here is where I call the function SaveUploadedFile:
<form class="dropzone" id="dropzoneForm" action="/SettingsMerchants/SaveUploadedFile/0" data-plugin="dropzone">
<div class="dz-message">
<h3 class="m-h-lg">Press here or drag some file to import</h3>
</div>
</form>
And I have a Jquery trigger to change that "action" value:
<script>
$("#selector").on("change", function (e) {
//e.preventDefault();
$('#dropzoneForm').attr('action', "/SettingsMerchants/SaveUploadedFile/" + $("#selector").val());
});
</script>
My problem is that when I drop a file always calls my function with '0'. But when I change the value on select/option it changes, if I go to browser console and type:
$('#dropzoneForm').attr('action')
I see the value changed.