0

我想在模式引导表单中设置一个日期选择器的输入字段,我创建了该表单,如下所示:

$('<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">&times;</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>
4

0 回答 0