views:

186

answers:

0

hi to all

I am using jquery colorbox and jquery date picker. My problem is date picker doesn't work in my popup window using jquery colorbox.

Any help would greatly appreciated.

please see my code below

I am using this plugin http://keith-wood.name/datepick.html

here is my form which containe bidthday

    <div id="add-employee-container">
        <form name="create_employee" id="create_employee" method="post" action="<?php echo site_url('admin/employee/save') ?>">
            <label><span class="text-red">* </span>First Name:</label><input name="firstname" type="text" class="required"/><br /><br />
            <label><span class="text-red">* </span>Middle Name:</label><input name="middlename" type="text" class="required"/><br /><br />    
            <label><span class="text-red">* </span>Last Name:</label><input name="lastname" type="text" class="required"/><br /><br />
            <label><span class="text-red">* </span>Birth Day:</label><input name="bday" type="text" class="required" id="date-pick"/><br /><br /> 
        </form>  
     </div>

here is my javascript

$(document).ready(function(){
    $('#date-pick').datepick();             
});

in the above code it works fine but when i used it in jquery colorbox it doesn't work anymore. call jquery colorbox below

$(".add-employee").colorbox({
    width:"50%",
    inline:true, 
    title:'&nbsp;',
    href:"#add-employee-container",
    onLoad: function(){
        $('#date-pick').datepick();         
    },
    onClosed: function (){
        validator.resetForm();
    },          
});