javascript - trigger colorbox resize on parsley validation -


ok using parsley.js validate , colorbox submit form via ajax

the problem facing cannot figure out how resize colorbox dynamically when validation errors appear.i trigger function when pasreley loads in errors.

$.colorbox.resize(); 

this form submit code looks like

   $("#form").submit(function(e)     {          if ( $(this).parsley('validate')) {              var postdata = new formdata(this);              var formurl = $(this).attr("action");              $.ajax({});         };           e.preventdefault();      }); 

try

$.listen('parsley:field:error', function(){$.colorbox.resize();}) 

if wish handle error event. see official documentation know event want handle. http://parsleyjs.org/doc/index.html#psly-events-list


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -