views:

25

answers:

1

hi guys, I am using color box, its really fun, but i am really stucked out by a problem that:

my form is opening in colorbox i am using jquery for validation in that form for which i am including validate.js in that page the problem is that i am not able to see the js file, when i open the page in window it is ok but when that page is opened in colorbox the javascript in not available. please help me

+1  A: 

From the Colorbox Home Page:

JavaScript/jQuery is not working inside of ColorBox.

This is often due to trying to access an element before it has been loaded into the document and can be resolved by moving the JavaScript into ColorBox's onComplete callback.

   //Example (using jQuery Forms plugin):
   $('#login_window').colorbox({onComplete:function(){
   $('form#login').ajaxForm();
   }});

It looks like you might just need to make use of the "onComplete" callback of the plugin.

Matthew
I was going to suggest `$(function(){})` but you can't top the manual! ;)
DavidYell