Código PHP:
Ver original
<?php echo '<div class="modal-header"> <h4 class="modal-title">Autorización de Matrículas</h4> </div> <div class="col-sm-2"> </div> <div class="col-sm-3"> </div> <div class="modal-body"> <form name="formcontract" method="post" action="autorizar.php" class="form-horizontal"> <div class="form-group"> <label class="col-sm-3 control-label" for="formGroup">Tractora</label> <div class="input-group col-sm-5"> <span class="input-group-addon"><span class="fa fa-keyboard-o"></span></span> <input class="form-control" type="text" name="matricula" id="formGroup" placeholder="AAA1234"> </div> </div> <div class="col-sm-12"> </div> <div class="col-sm-12"> </div> <div class="form-group"> <label class="col-sm-3 control-label" for="formGroup">Remolque</label> <div class="input-group col-sm-5"> <span class="input-group-addon"><span class="fa fa-keyboard-o"></span></span> <input class="form-control" type="text" name="matricular" id="formGroup" placeholder="AAA1234"> </div> </div> <div class="col-sm-12"> </div> <div class="col-sm-12"> </div> <div class="form-group"> <label class="col-sm-3 control-label" for="formGroup">N.I.F-N.I.E</label> <div class="input-group col-sm-5"> <span class="input-group-addon"><span class="fa fa-credit-card"></span></span> <input class="form-control" type="text" name="dni" id="formGroup" placeholder="DNI o PASAPORTE"> </div> </div> <div class="col-sm-12"> </div> <div class="col-sm-12"> </div> <div class="form-group"> <label class="col-sm-3 control-label" for="formGroup">Conductor</label> <div class="input-group col-sm-5"> <span class="input-group-addon"><span class="entypo-user"></span></span> <input class="form-control" type="text" name="xofer" id="formGroup" placeholder="Nombre y Apellido"> </div> </div> <div class="col-sm-12"> </div> <div class="col-sm-12"> </div> <div class="form-group"> <label class="col-sm-3 control-label" for="formGroup">P.M.A</label> <div class="input-group col-sm-5"> <span class="input-group-addon"><span class="entypo-download"></span></span> <select name="pma" class="selectboxit"> <option>40.800</option> <option>41.000</option> <option>44.000</option> </select> </div> </div> </div> <div class="modal-footer"> <button class="btn btn-submit" name="button" data-dismiss="modal">Ok</button> </div> </form>';
Si lo lanzo directamente en el navegador , funciona perfectamente , pero cuando lo lanzo desde un modal , que lo llamo asi:
Código Javascript:
Ver original
<a class="btn btn-primary" id="BOTONPARAABRIRMODAL"> <i class="entypo-plus" data-toggle="modal" data-target="#myModal2">Autorizar Matrículas</i> </a> <script type="text/javascript"> $("#BOTONPARAABRIRMODAL").click(function(){ $.ajax({ method: "POST", //Elige get o post url: "contratos8.php", }) .done(function( msg ) { $("#mbody").html(msg); $("#myModal2").show(); }); }); </script>
dentro del modal le doy al ok y se cierra el modal y no hace su funcion
alguien sabe porque??