I have implemented DropzoneJS for purpose of galery. I have to add more fields: Name of galery, submit...
I have this code:
<script src="assets/libs/dropzone/dropzone.js"></script>
<link rel="stylesheet" href="assets/libs/dropzone/dropzone.css">
<form id="form" action="assets/libs/dropzone/upload.php" method="post" enctype="multipart/form-data" class="dropzone">
<input name="name" type="text" placeholder="Galery name*"/> <br/>
<div class="fallback">
<input name="file" type="file" multiple />
</div>
<input name="submit" type="submit" />
It looks like this:
How to proccess selected images with jQuery(Ajax), how to send it to php script: $("input[name=file]").val()
-> doesn't work, expected.
EDIT: I need only name of file
$( ".fileInput" ).each(function( index ) {
console.log( "file name: " + $( this ).val() );
});
should work fine within loop for multiple fields.
About sending file to server via Ajax is different problem. Here is a great example which suits your needs( Ajax/Jquery - PHP )