我想在modal bootstrap表单中设置一个输入字段datepicker,我创建了如下表单:
$('<div id="myModal" class="modal hide fade">' + data + '</div>').modal();
我尝试将其分配给var进行访问和设置,但没有任何变化......
var self = $('<div id="myModal" class="modal hide fade">' + data + '</div>').modal();
self.find(".input-date").datepicker();
有什么想法吗?
问候!
使用数据代码进行编辑
<form class ="form" method="POST" action="{{ request.path }}">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Editar Empleado</h3>
</div>
<div class="modal-body">
<p>
<label for="input-date">Date:</label>
<input class="input-date" type="text" />
</p>
</div>
<div class="modal-footer">
<a href="#" data-dismiss="modal" class="cerrar btn">Cerrar</a>
<input type="submit" class="guardar btn btn-primary" value="Guardar">
</div>
</form>