Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/02/2012, 21:21
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 1 mes
Puntos: 192
Respuesta: Crear datepicker dinamicamente con javascript

Podrías usar .delegate(). Así:
http://jsbin.com/emamiz (ir a "Edit in jsbin.com" para ver el código fuente)


Código Javascript:
Ver original
  1. $(function(){
  2.       $('.form-con-fechas').delegate('.campofecha','focusin',function(){
  3.         $(this).datepicker();
  4.       });
  5.      
  6.      
  7.       $('.agregar-campo').click(function(){
  8.         $('.campofecha').last().after('<input class="campofecha" type="text" />');
  9.       });
  10.     });
__________________
nahueljose.com.ar