Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery Validation plugin and Colorbox

Does anyone know the best way to get the Jquery Validation plugin to run when submitting a form that has been loaded dynamically into a Jquery Colorbox modal window?

like image 570
Damien Majer Avatar asked Dec 01 '25 21:12

Damien Majer


1 Answers

Add the validation set up to the colorbox callback. That way the color box has been loaded and the form exists before you attempt to set up validation for it.

 $('selector').colorbox({...options...}, function() {
     $('form',this).validate( {...options...} );
 });
like image 112
tvanfosson Avatar answered Dec 04 '25 15:12

tvanfosson