I am currently using the Twitter Bootstrap framework, and when using the modal windows I cannot get over js elements to work like datepicker or validation, though chosen and
try use this code it works for me. by the way it came from this site https://github.com/eternicode/bootstrap-datepicker/issues/464 .
$('#datepicker').datepicker().on('show', function () {
var modal = $('#datepicker').closest('.modal');
var datePicker = $('body').find('.datepicker');
if (!modal.length) {
$(datePicker).css('z-index', 'auto');
return;
}
var zIndexModal = $(modal).css('z-index');
$(datePicker).css('z-index', zIndexModal + 1);
});