Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm having a problem sending the images have a text area field for the client to send a description of the photo, and when he sent to the database sends as if all had the same description that was being inserted only one description,

I'm using the library DROPZONE.JS http://dropzonejs.com/

Follow my code .. Help me please.

Dropzone.options.upload = {
    thumbnailWidth: 246,
    thumbnailHeight: 173,
    enqueueForUpload:false,
    paramName: "userfile",
    sending: function(file, xhr, formData) {    
        formData.append("titulo", $("#titulo").val());
        formData.append("evento", <?php echo $this->uri->segment(4); ?>);
        formData.append("capa", $("#cap").val());
    }
};

function upload() {
    var dz = Dropzone.forElement("#upload");
    for (var i = 0; i < dz.files.length; i++) {
        dz.filesQueue.push(dz.files[i]);
    }
    dz.processQueue(); 
}
share|improve this question

1 Answer

When you use $("#titulo") you refer to the input / textarea having the id of titulo.

For example <input type="text" id="titulo">.

There can only be one DOM element having an id in the whole document.

Change your element to <input type="text" class="titulo"> then you use something like $(".titulo")[0], $(".titulo")[1] to select the fields.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.