提交后我无法关闭模式

时间:2014-09-03 21:04:20

标签: twitter-bootstrap

提交后我无法关闭窗口.. 这是我的模态和我的链接按钮:

<div style="float:left;padding-left: 5%;padding-top: 5px">
    <?php echo $this->Html->link('Agregar aéreo', array('controller' => 'aereos', 'action' => 'add', $paquete), array('class' => 'actions a btn btn-primary', 'data-toggle' => 'modal', 'data-target' => '#aereoLoad')); ?>    
</div>

<div class="modal fade" id="aereoLoad" tabindex="-1" role="dialog" aria-labelledby="agregarPasajeroLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="agregarPasajeroLabel">Agregar aéreo</h4>
            </div>
            <div id="circularG">
                <div id="circularG_1" class="circularG"></div>
                <div id="circularG_2" class="circularG"></div>
                <div id="circularG_3" class="circularG"></div>
                <div id="circularG_4" class="circularG"></div>
                <div id="circularG_5" class="circularG"></div>
                <div id="circularG_6" class="circularG"></div>
                <div id="circularG_7" class="circularG"></div>
                <div id="circularG_8" class="circularG"></div>
            </div>
            <div class="modal-footer">
                <div style="float:left;width:85%">
                    <button type="button" class="btn btn-default" data-dismiss="modal" style="margin-right: 0;">Cerrar</button>
                </div>
                <div style="float:right;width:10%">
                    <button id="" class="btn btn-success" style="margin-right: 0;">Guardar</button>
                </div>
            </div>
        </div>
    </div>
</div>

然后,这是我在modal中调用的视图中的提交按钮。

<div style="float:right;width:10%">
    <?php echo $this->Js->submit('Guardar', 
                      array('id' => 'cerrar_modal', 
                      'url' => array('controller' => 'aereos', 'action' => 'add'), 
                      'success' => 'cargarAereo($("#precio").val(),$("#personas").val(),$("#tipomoneda").val(),$("#concepto").val(),$("#id").val());', 
                      'class' => 'btn btn-success')); ?>
    <?php echo $this->Js->writeBuffer(array('inline' => 'true')); ?>
    <?php echo $this->Form->end(null); ?>
</div>

我需要关闭模态并清除他的数据,但模式并不是靠自己和命令&#34; $(&#34;#aereoLoad&#34;)。模态(&#39 ;隐藏&#39;)&#34;不要为我工作..

我不会说英语,我希望你能理解

1 个答案:

答案 0 :(得分:0)

要关闭Bootstrap 3模式,您应该使用:

$('#aereoLoad').modal('hide');