jquery - How to check images are added in dropzone before posting ajax properly? -
i've attempted write script check if there images dropped on dropzone. i'm using twitter bootstrap.
the ajax script runs on submit is:
$.ajax({ type: method, action: action, data: formdata, processdata: false, contenttype: false, datatype: 'json', beforesend: function(xhr) { if (mydropzone.getqueuedfiles().length == 0) { // i've managed values of number of images dropped. // want inform user they've not added images, // can continue submit without adding images if click on continue on modal // or click cancel , drop images. } }, success: function(data) { console.log(data); }, error: function(data) { var errors = data.responsejson; console.log(data); $.each(errors, function(key, value) { $('#' + key).after('<div class="alert alert-danger">' + value + '</div>'); }); } });
i'm not sure how achieve that. thank reading
Comments
Post a Comment