Im export excel используя bootstrap modal, но после отправки моего модального не близко. мне нужно закрыть вручную.Как закрыть Bootstrap Modal после отправки формы на Laravel?
<button type="button" id="taxModal" class="btn btn-primary btn-group-xs">INVOICE SUMMARY</button>
<div id="taxesModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">GENERATE TAX INVOICE</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" role="form" method="POST" action="{{ url('/invoice') }}">
{!! csrf_field() !!}
<div class="form-group{{ $errors->has('start_date') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">START DATE</label>
<div class="col-md-6">
<input type="date" class="form-control" name="start_date">
@if ($errors->has('start_date'))
<span class="help-block">
<strong>{{ $errors->first('start_date') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('end_date') ? ' has-error' : '' }}">
<label class="col-md-4 control-label">END DATE</label>
<div class="col-md-6">
<input type="date" class="form-control" name="end_date">
@if ($errors->has('end_date'))
<span class="help-block">
<strong>{{ $errors->first('end_date') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group ">
<div class="col-md-3 col-md-offset-3">
<button type="submit" class="btn btn-primary form-control" id="btnSubmit" >Submit</button>
</div>
<div class="col-md-3">
<button type="button" class="btn btn-danger form-control" data-dismiss="modal">Close</button>
</div></div>
</form>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
от моего contoller im, создающего документ Excel успешно, но мой модальный не закрывающий после отправки. Я устал data-dismiss="modal"
в моей кнопке, но модальный закроет перед отправкой формы. в моем контроллере я попробовал return rediect();
, что тоже не работает. им открыть этот модальный используя ниже сценария функцию
$(document).ready(function() {
$("#taxModal").click(function() {
$("#taxesModal").modal('show');
});
});
мой контроллер
public function invoice_create()
{
$start = Input::get('start_date');
$end = Input::get('end_date');
Excel::create('INVOICE SUMMERY', function($excel) use($sum,$tot,$start,$end) {
$excel->sheet($start.'_'.$end, function($sheet) use($sum,$tot,$start,$end){
})->export('xls');
}}
Мой маршрут:
Route::post('invoice','[email protected]_create');
Почему бы не использовать триггер «$ (« .tt-danger »). (После нажатия кнопки«) »после отправки данных? –