ruby on rails - Dropzone.js and form validation -


is possible not break nice rails form validation errors displayed after marking whole form 'dropzone' class?

now, when try submit form, nothing changes , page stays @ without providing info user fields doesn't meet requirements. controller renders json response (dropzone using consequence) seems not processed view.

thank in advance quick response.

my workaround problem:

dropzone.options.filedrop = {     init: function () {         // other triggers not listed         // ...          this.on("error", function (file, response) {             // gets triggered when files have been sent.             // redirect user or notify of success.              // build unordered list list of errors             var _ref, _results, _i, _len;             if ($.isplainobject(response)) { // check if response in json format showing standard form errors                 // remove errors accepted image                 file.previewelement.classlist.remove("dz-error");                 _ref = file.previewelement.queryselectorall("[data-dz-errormessage]");                 _results = [];                 (_i = 0, _len = _ref.length; _i < _len; _i++) {                     node = _ref[_i];                     _results.push(node.textcontent = null);                 }                  file['status'] = 'success';                 console.log("acceptedimage: " + json.stringify(file));                  var json = response;                 var errortext = "<div id=\"error_explanation\"><h2>" + object.keys(json).length + " errors prohibited thing being saved:</h2><ul>";                 $.each(json, function (key, value) {                     errortext += "<li>" + key.capitalize() + ' ' + value[0] + "</li> ";                 });                 errortext += "</ul></div>";                 console.log("errortext: " + errortext);                  // insert error list form                 $('.errors_placeholder').html(errortext);             } else {                 if (mydropzone.files.length > 1) {                     mydropzone.removefile(mydropzone.files[0]);                 }             }         });     } }; 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -